/**
 * employment-history styles (Wave D4)
 * Extracted from root styles.css.
 */

/* --- from styles.css L8095-L8798 --- */
/* === Employment History & Timeline Styles === */

/* Filter Tabs */
.employment-filter-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin: 16px 0;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.filter-tab:hover {
    background: var(--bg-hover);
    border-color: var(--brand-color);
}

.filter-tab.active {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: var(--text-on-brand);
    font-weight: 600;
}

.filter-tab i {
    font-size: 1.1em;
}

.count-badge {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.filter-tab.active .count-badge {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-on-brand);
}

/* Employment Stats Grid */
.employment-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-surface-2);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.employment-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: var(--bg-surface-1);
    border-radius: 8px;
}

.employment-stats .stat-item.highlight {
    background: rgba(var(--brand-color-rgb), 0.1);
    border: 1px solid var(--brand-color);
}

.employment-stats .stat-value {
    font-size: var(--font-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.employment-stats .stat-item.highlight .stat-value {
    color: var(--brand-fg, var(--brand-color));
}

.employment-stats .stat-label {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    text-align: center;
}

/* Employment History List */
.employment-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.employment-card {
    padding: 16px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.employment-card:hover {
    background: var(--bg-hover);
    border-color: var(--brand-color);
}

.employment-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.employment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-surface-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: var(--brand-fg, var(--brand-color));
}

.employment-info {
    flex: 1;
}

.employment-name {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.employment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.employment-count-badge {
    background: var(--brand-color);
    color: var(--text-on-brand);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--font-xs);
    font-weight: 600;
}

.employment-positions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.position-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 4px;
    background: var(--bg-surface-1);
    border-radius: 6px;
}

.position-entry.current {
    border-left: 3px solid var(--brand-color);
    background: rgba(var(--brand-color-rgb), 0.05);
}

.position-label {
    font-weight: 600;
    color: var(--text-primary);
}

.position-dates {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.position-current-badge {
    background: var(--success-color);
    color: #121212;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: var(--font-xs);
    font-weight: 600;
    margin-left: 8px;
}

.position-rehire-badge {
    background: var(--warning-color);
    color: #121212;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: var(--font-xs);
    font-weight: 600;
    margin-left: 8px;
}

/* Visibility Restricted Badge (Jan 2026) */
.visibility-restricted-badge {
    background: var(--text-secondary);
    color: var(--bg-main);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: var(--font-xs);
    font-weight: 600;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.employment-phone {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    color: var(--text-secondary);
}

/* Assessment Summary in Employee Cards (Jan 2026) */
.assessment-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.assessment-score-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.weighted-score {
    font-size: 1.4em;
    font-weight: bold;
}

.score-label {
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

.assessment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.formula-tooltip-btn {
    background: none;
    border: none;
    color: var(--brand-fg, var(--brand-color));
    cursor: pointer;
    font-size: var(--font-xs);
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.formula-tooltip-btn:hover {
    background: rgba(var(--brand-color-rgb), 0.1);
}

.formula-detail {
    font-family: var(--font-mono, monospace);
    line-height: 1.5;
}

.formula-detail pre {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Visibility Notice Box */
.visibility-notice {
    background: var(--bg-surface-1);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid var(--info-color);
}

.visibility-notice p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Career Stats Grid (User Dashboard) */
.career-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-surface-2);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.career-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-surface-1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.career-stat-card:hover {
    background: var(--bg-hover);
}

.career-stat-card.highlight {
    background: rgba(var(--brand-color-rgb), 0.1);
    border: 1px solid var(--brand-color);
}

.career-stat-card i {
    font-size: 2em;
    color: var(--brand-fg, var(--brand-color));
}

.career-stat-card .stat-value {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.career-stat-card .stat-label {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    text-align: center;
}

/* Position Timeline */
.position-timeline {
    position: relative;
    padding: 20px 0 20px 40px;
}

.position-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--brand-color) 0%, var(--border-color) 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding-left: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 8px;
    width: 14px;
    height: 14px;
    background: var(--bg-surface-1);
    border: 3px solid var(--brand-color);
    border-radius: 50%;
    z-index: 1;
}

.timeline-item.current::before {
    background: var(--brand-color);
    box-shadow: 0 0 0 4px rgba(var(--brand-color-rgb), 0.2);
}

.timeline-item.rehire::before {
    border-color: var(--warning-color);
}

.timeline-content {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    transition: all 0.2s ease;
}

.timeline-content:hover {
    background: var(--bg-hover);
    border-color: var(--brand-color);
}

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

.timeline-company {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-position {
    font-size: var(--font-sm);
    color: var(--brand-fg, var(--brand-color));
    margin-top: 4px;
}

.timeline-dates {
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.timeline-tenure {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.timeline-gap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin: 12px 0 12px 24px;
    background: rgba(var(--brand-color-rgb), 0.05);
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.timeline-gap i {
    color: var(--warning-text, var(--warning-color));
}

/* HC → Karyawan → Riwayat (table + expandable detail) */
#hc-emp-history-subsection .emp-history-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#hc-emp-history-subsection .emp-history-header h4 {
    margin: 0 0 6px;
    font-size: var(--font-lg);
    display: flex;
    align-items: center;
    gap: 8px;
}

#hc-emp-history-subsection .emp-history-header .helper-text {
    margin: 0;
}

#hc-emp-history-subsection .emp-history-stats {
    margin: 0;
}

#hc-emp-history-subsection .emp-history-toolbar {
    margin: 0;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

#hc-emp-history-subsection .emp-history-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

#hc-emp-history-subsection .emp-history-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

#hc-emp-history-subsection .emp-history-search-wrap input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: var(--font-sm);
    background: var(--bg-card);
    color: var(--text-primary);
}

#hc-emp-history-subsection .emp-history-filter-tabs {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
    flex-wrap: wrap;
}

#hc-emp-history-subsection .emp-history-visibility-notice {
    margin: 0;
}

.emp-history-table-wrapper {
    max-height: min(70vh, 640px);
    overflow: auto;
}

.emp-history-table .emp-history-col-action {
    width: 48px;
    text-align: center;
}

.emp-history-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.emp-history-avatar-img,
.emp-history-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.emp-history-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-1);
    color: var(--brand-fg, var(--brand-color));
    font-size: 1.1em;
}

.emp-history-name-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.emp-history-name {
    font-weight: 600;
    color: var(--text-primary);
}

.emp-history-email {
    font-size: var(--font-xs);
}

.emp-history-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.emp-history-status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: var(--font-xs);
    font-weight: 600;
}

.emp-history-status-active {
    background: rgba(var(--success-color-rgb, 45, 106, 79), 0.15);
    color: var(--success-color);
}

.emp-history-status-past {
    background: var(--bg-surface-1);
    color: var(--text-secondary);
}

.emp-history-period {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

.emp-history-score-cell {
    font-weight: 600;
    text-align: center;
}

.emp-history-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.emp-history-expand-btn:hover {
    background: var(--bg-hover);
    border-color: var(--brand-color);
    color: var(--brand-fg, var(--brand-color));
}

.emp-history-detail-row > td {
    padding: 0 !important;
    background: var(--bg-surface-1);
    border-top: none;
}

.emp-history-detail-panel {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.emp-history-detail-section h5 {
    margin: 0 0 10px;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.emp-history-row:hover td {
    background: var(--bg-hover);
}

/* Responsive */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .employment-filter-tabs,
    #hc-emp-history-subsection .emp-history-filter-tabs {
        flex-wrap: wrap;
    }

    .filter-tab {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    #hc-emp-history-subsection .emp-history-toolbar .section-toolbar-left,
    #hc-emp-history-subsection .emp-history-toolbar .section-toolbar-right {
        width: 100%;
        max-width: none;
    }

    #hc-emp-history-subsection .emp-history-search-wrap {
        max-width: none;
    }

    .employment-stats,
    #hc-emp-history-subsection .emp-history-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .career-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .position-timeline {
        padding-left: 30px;
    }
}


