/* ==========================================================================
   HAI VAN HRM - PROFILE & EMPLOYEE DIRECTORY (BASE HRM 360° REPLICA)
   Matches Base HRM Directory (Screenshot 1) & 360° Profile (Screenshot 2)
   ========================================================================== */

/* Main Container */
.hrm-profile-container {
    padding: 0;
    margin: 0;
    min-height: calc(100vh - 70px);
    background: #f4f6fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2b3648;
}

/* -------------------------------------------------------------
   DIRECTORY VIEW (SCREENSHOT 1)
   ------------------------------------------------------------- */
.hrm-dir-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin: 16px;
    overflow: hidden;
}

/* Header & Sub-Tabs */
.hrm-dir-header {
    padding: 16px 20px 0 20px;
    border-bottom: 1px solid #e5e9f2;
    background: #ffffff;
}

.hrm-dir-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.hrm-dir-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hrm-dir-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hrm-btn-create {
    background: #1b64da;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.hrm-btn-create:hover {
    background: #1451b8;
}

/* Sub-tabs bar */
.hrm-dir-tabs {
    display: flex;
    align-items: center;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.hrm-dir-tabs::-webkit-scrollbar {
    display: none;
}

.hrm-dir-tab {
    padding: 10px 4px 12px 4px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
    user-select: none;
}

.hrm-dir-tab:hover {
    color: #1b64da;
}

.hrm-dir-tab.active {
    color: #1b64da;
    font-weight: 700;
}

.hrm-dir-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #1b64da;
    border-radius: 3px 3px 0 0;
}

.hrm-dir-tab-more {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.hrm-dir-tab-more span {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hrm-dir-tab-more span:hover {
    color: #1b64da;
}

/* Toolbar & Filters */
.hrm-dir-toolbar {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #edf2f7;
    flex-wrap: wrap;
    gap: 10px;
}

.hrm-dir-tools-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hrm-search-box {
    position: relative;
    width: 250px;
}

.hrm-search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
}

.hrm-search-input {
    width: 100%;
    padding: 6px 12px 6px 32px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    transition: all 0.15s ease;
}

.hrm-search-input:focus {
    border-color: #1b64da;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(27, 100, 218, 0.12);
}

.hrm-filter-btn {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    font-size: 0.83rem;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.hrm-filter-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.hrm-filter-select {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    font-size: 0.83rem;
    color: #334155;
    outline: none;
    cursor: pointer;
}

.hrm-filter-select:focus {
    border-color: #1b64da;
}

/* Table */
.hrm-table-responsive {
    overflow-x: auto;
    min-height: 480px;
}

.hrm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    text-align: left;
}

.hrm-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.77rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    user-select: none;
}

.hrm-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #edf2f7;
    color: #334155;
    vertical-align: middle;
}

.hrm-table tbody tr {
    transition: background 0.1s ease;
    cursor: pointer;
}

.hrm-table tbody tr:hover {
    background: #f1f5f9;
}

/* Employee cell */
.hrm-emp-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hrm-emp-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #1b64da;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
    border: 1px solid #cbd5e1;
}

.hrm-emp-name {
    font-weight: 600;
    color: #0f172a;
    transition: color 0.15s ease;
}

.hrm-table tbody tr:hover .hrm-emp-name {
    color: #1b64da;
}

.hrm-emp-code {
    font-weight: 600;
    color: #059669;
}

.hrm-emp-username {
    color: #64748b;
    font-size: 0.82rem;
}

/* Status Badges */
.hrm-badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
}

.hrm-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hrm-badge-dot.chinh-thuc {
    background: #10b981;
}

.hrm-badge-dot.thu-viec {
    background: transparent;
    border: 2px solid #10b981;
}

.hrm-badge-dot.tam-nghi {
    background: #f59e0b;
}

.hrm-badge-dot.da-nghi {
    background: #94a3b8;
}

/* Table Footer / Pagination */
.hrm-dir-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    font-size: 0.84rem;
    color: #64748b;
}

.hrm-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hrm-page-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
    color: #334155;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.hrm-page-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.hrm-page-btn.active {
    background: #1b64da;
    border-color: #1b64da;
    color: #ffffff;
    font-weight: 700;
}

.hrm-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* -------------------------------------------------------------
   360° PROFILE VIEW (SCREENSHOT 2)
   ------------------------------------------------------------- */
.hrm-profile-view {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Top Back / Breadcrumb Bar */
.hrm-profile-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hrm-back-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.hrm-back-btn:hover {
    background: #f1f5f9;
    color: #1b64da;
    border-color: #1b64da;
}

.hrm-profile-header-meta {
    display: flex;
    flex-direction: column;
}

.hrm-profile-header-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.hrm-profile-header-sub {
    font-size: 0.8rem;
    color: #64748b;
    margin: 2px 0 0 0;
}

.hrm-profile-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 2-Column Layout */
.hrm-profile-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .hrm-profile-layout {
        grid-template-columns: 1fr;
    }
}

/* Left Sidebar Card */
.hrm-profile-card-left {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: sticky;
    top: 16px;
}

.hrm-profile-user-summary {
    padding: 24px 20px 18px 20px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.hrm-profile-avatar-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 12px auto;
}

.hrm-profile-avatar-img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #1b64da;
}

.hrm-profile-online-dot {
    position: absolute;
    bottom: 4px;
    right: 6px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.hrm-profile-period-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 6px;
}

.hrm-profile-user-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.hrm-profile-user-title {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0 0 12px 0;
}

.hrm-profile-tenure-badge {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #ffe4e6;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.hrm-profile-quick-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
    color: #475569;
    text-align: left;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 6px;
}

.hrm-profile-quick-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    word-break: break-all;
}

.hrm-profile-quick-meta-item i {
    color: #94a3b8;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Left Sub-Navigation Menu */
.hrm-profile-menu {
    padding: 8px 0;
}

.hrm-profile-menu-item {
    padding: 10px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    user-select: none;
}

.hrm-profile-menu-item:hover {
    background: #f8fafc;
}

.hrm-profile-menu-item.active {
    background: #eff6ff;
    border-left-color: #1b64da;
}

.hrm-profile-menu-icon {
    font-size: 1.15rem;
    color: #64748b;
    margin-top: 2px;
    flex-shrink: 0;
}

.hrm-profile-menu-item.active .hrm-profile-menu-icon {
    color: #1b64da;
}

.hrm-profile-menu-text {
    display: flex;
    flex-direction: column;
}

.hrm-profile-menu-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
}

.hrm-profile-menu-item.active .hrm-profile-menu-title {
    color: #1b64da;
    font-weight: 700;
}

.hrm-profile-menu-desc {
    font-size: 0.74rem;
    color: #94a3b8;
    margin-top: 1px;
}

/* Right Main Panel */
.hrm-profile-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Profile Section Card (Matching Base HRM) */
.hrm-section-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 20px 24px;
    border: 1px solid #f1f5f9;
}

.hrm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.hrm-section-title-wrap {
    display: flex;
    flex-direction: column;
}

.hrm-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.hrm-section-sub {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

.hrm-section-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: #1b64da;
    cursor: pointer;
}

.hrm-section-links a {
    color: #1b64da;
    text-decoration: none;
    font-weight: 600;
}

.hrm-section-links a:hover {
    text-decoration: underline;
}

/* 4-Column Grid for Information Fields */
.hrm-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 24px;
}

@media (max-width: 1200px) {
    .hrm-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .hrm-info-grid {
        grid-template-columns: 1fr;
    }
}

.hrm-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hrm-field-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    font-weight: 600;
}

.hrm-field-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hrm-field-val.highlight {
    color: #10b981;
}

.hrm-field-val.secondary {
    color: #475569;
    font-weight: 500;
}

.hrm-field-val i {
    color: #64748b;
    font-size: 0.95rem;
}

/* Section Subheader (e.g. THÔNG TIN NƠI SỐNG) */
.hrm-sub-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: #059669;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    grid-column: 1 / -1;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

/* Expandable / Accordion */
.hrm-accordion-link {
    font-size: 0.83rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.hrm-accordion-link:hover {
    color: #1b64da;
}

/* Integrated KRA & Evaluations Tab Cards */
.hrm-eval-summary-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.hrm-eval-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hrm-eval-stat-label {
    font-size: 0.76rem;
    color: #bfdbfe;
    text-transform: uppercase;
    font-weight: 600;
}

.hrm-eval-stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
}

.hrm-kra-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.hrm-kra-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.hrm-kra-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #0f172a;
}

.hrm-kra-weight {
    background: #e0f2fe;
    color: #0284c7;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.hrm-kra-desc {
    font-size: 0.82rem;
    color: #475569;
}
