/*
 * Client portal, People's pages: one employee's details.
 * Loaded on every portal page by workerHrPortalHead() (app_customers_head).
 *
 * Colours are the portal theme's own (assets/themes/perfex/css/style.css: the slate scale) and its accent, the one the top bar's active entry
 * uses. The rows are the shared component (assets/css/components/field.css).
 */

:root {
    /* Fallbacks only: the tenant's accent is written on body.customers by workerHrPortalNavStyle(). */
    --ido-portal-accent: #a93593;
    --ido-portal-line: #e5e7eb;
    --ido-portal-surface: #ffffff;
    --ido-portal-surface-soft: #f9fafb;
    --ido-portal-text: #111827;
    --ido-portal-text-soft: #374151;
    --ido-portal-text-muted: #6b7280;
}

/* ---- The page heading: the actions ---------------------------------------------------------- */

/* Wraps instead of squeezing: the buttons keep their own text on a narrow screen. */
.worker-hr-portal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--ido-space-3, 12px) var(--ido-space-4, 16px);
    margin-bottom: var(--ido-space-4, 16px);
}

.worker-hr-portal-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* ---- The summary card: who, in what status, and the key facts (board "Employee header") -------------------------------- */

.worker-hr-portal-summary {
    margin-bottom: 16px;
    background: var(--ido-portal-surface);
    border: 1px solid var(--ido-portal-line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    overflow: hidden;
}

.worker-hr-portal-summary-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 12px;
}

.worker-hr-portal-summary-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1 1 320px;
}

/* The tenant's soft accent, not a fixed violet: the initials in the accent as text (board "Employee header", 2 Avatar). */
.worker-hr-portal-avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ido-portal-accent-soft, #f3f4f6);
    color: var(--ido-portal-accent-text, #374151);
    font-size: 16px;
    font-weight: 600;
}

.worker-hr-portal-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: none;
}

.worker-hr-portal-summary-actions .worker-hr-portal-btn { height: 36px; padding: 0 14px; font-size: 13px; }

.worker-hr-portal-summary-text { min-width: 0; }

/* One line with an ellipsis, the full name in the title attribute. */
.worker-hr-portal-name {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ido-portal-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Under the name: the code in mono, then the job position and the project, a dot between. */
.worker-hr-portal-summary-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--ido-portal-text-soft);
}

.worker-hr-portal-code {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 13px;
    font-weight: 400;
    color: var(--ido-portal-text-muted);
}

.worker-hr-portal-chip { font-size: 14px; color: var(--ido-portal-text-soft); }
.worker-hr-portal-chip + .worker-hr-portal-chip::before { content: "\00b7"; margin-right: 8px; color: #9ca3af; }

/* The status as a dot and a word, in the tone of People's status map; the sentence beside it. */
.worker-hr-portal-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 400;
    color: var(--ido-portal-text-soft);
    white-space: nowrap;
}

.worker-hr-portal-pill-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
}

.worker-hr-portal-pill.is-success { color: var(--ido-portal-text-soft); }
.worker-hr-portal-pill.is-success .worker-hr-portal-pill-dot { background: #10b981; }
.worker-hr-portal-pill.is-info { color: var(--ido-portal-text-soft); }
.worker-hr-portal-pill.is-info .worker-hr-portal-pill-dot { background: #3b82f6; }
.worker-hr-portal-pill.is-warning { color: var(--ido-portal-text-soft); }
.worker-hr-portal-pill.is-warning .worker-hr-portal-pill-dot { background: #f59e0b; }
.worker-hr-portal-pill.is-pending { color: var(--ido-portal-text-soft); }
.worker-hr-portal-pill.is-pending .worker-hr-portal-pill-dot { background: #ca8a04; }
.worker-hr-portal-pill.is-danger { color: var(--ido-portal-text-soft); }
.worker-hr-portal-pill.is-danger .worker-hr-portal-pill-dot { background: #ef4444; }

.worker-hr-portal-summary-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 0 24px 16px;
    font-size: 13px;
    color: var(--ido-portal-text-muted);
}

.worker-hr-portal-summary-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ido-portal-text-muted); }

/* Key facts: one gray strip, a line between facts; six across, three at 834, two on a phone. */
.worker-hr-portal-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    border-top: 1px solid var(--ido-portal-line);
    background: var(--ido-portal-surface-soft);
}

.worker-hr-portal-tile {
    display: block;
    min-width: 0;
    padding: 12px 16px;
    border-left: 1px solid var(--ido-portal-line);
}

.worker-hr-portal-tile:first-child { border-left: 0; }

.worker-hr-portal-tile-label { display: block; font-size: 12px; font-weight: 400; color: var(--ido-portal-text-muted); }

.worker-hr-portal-tile-value {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ido-portal-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Three across on a tablet, two on a phone; a line between the rows (board "Employee header", 834 and 390). */
@media (max-width: 1023px) {
    .worker-hr-portal-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .worker-hr-portal-tile:nth-child(3n + 1) { border-left: 0; }
    .worker-hr-portal-tile:nth-child(n + 4) { border-top: 1px solid var(--ido-portal-line); }
}

/* ---- The tab bar and the section cards (board "Employee page: header, tabs and key facts") ---------------------------------- */

.worker-hr-portal-details { margin: 0; }

.worker-hr-portal-tabcard {
    margin-bottom: 16px;
    background: var(--ido-portal-surface);
    border: 1px solid var(--ido-portal-line);
    border-radius: 16px;
    overflow: hidden;
}

.worker-hr-portal-tabcard .horizontal-scrollable-tabs { margin: 0; }
.worker-hr-portal-tabcard .horizontal-tabs { margin: 0; }
.worker-hr-portal-tabcard .horizontal-scrollable-tabs .horizontal-tabs .nav-tabs-horizontal {
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0 24px;
    border-bottom: 0;
    border-radius: 0;
    background: transparent;
    /* Narrow screens scroll the tabs sideways instead of wrapping or overlapping them. */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.worker-hr-portal-tabcard .nav-tabs-horizontal::-webkit-scrollbar { display: none; }
.worker-hr-portal-tabs .nav-tabs-horizontal > li { flex: none; }
.worker-hr-portal-tabcard .nav-tabs-horizontal::before,
.worker-hr-portal-tabcard .nav-tabs-horizontal::after { content: none; }

.worker-hr-portal-tabs .nav-tabs-horizontal > li { float: none; margin: 0; }

.worker-hr-portal-tabs .nav-tabs-horizontal > li > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--ido-portal-text-soft);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.worker-hr-portal-tabs .nav-tabs-horizontal > li > a:hover,
.worker-hr-portal-tabs .nav-tabs-horizontal > li > a:focus {
    color: var(--ido-portal-text);
    background: transparent;
    border-bottom-color: transparent;
}

.worker-hr-portal-tabs .nav-tabs-horizontal > li.active > a,
.worker-hr-portal-tabs .nav-tabs-horizontal > li.active > a:hover,
.worker-hr-portal-tabs .nav-tabs-horizontal > li.active > a:focus {
    font-weight: 600;
    color: var(--ido-portal-accent-text, var(--ido-portal-accent));
    background: transparent;
    border-bottom-color: var(--ido-portal-accent-text, var(--ido-portal-accent));
}

/* A count beside a tab's label (Documents, Change requests): a quiet pill, tinted while its tab is open. */
.worker-hr-portal-tabs .nav-tabs-horizontal > li > a .badge {
    min-width: 0;
    height: 20px;
    margin-left: 0;
    padding: 0 6px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
}

.worker-hr-portal-tabs .nav-tabs-horizontal > li.active > a .badge {
    background: var(--ido-portal-accent-soft, #fdf2fa);
    color: var(--ido-portal-accent-text, #86266f);
}

.worker-hr-portal-tabs .nav-tabs-horizontal > li.is-locked > a { color: var(--ido-portal-text-muted); }
.worker-hr-portal-tabs .nav-tabs-horizontal > li.is-locked > a .menu-icon { font-size: 12px; }

/* ---- A section's fields: label above its value, two columns ---------------------------------------------------------------- */

/*
 * The rows are the shared component (assets/css/components/field.css); here each reads as the board draws it: the label (13px) above
 * the value (14px), the pencil at the label's end, two columns from 576px with a 32px gutter, one on a phone.
 */
.worker-hr-portal-section-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ido-portal-text);
}

.worker-hr-portal-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 32px;
    margin: 0;
}

.worker-hr-portal-fields .worker-hr-portal-field {
    position: relative;
    display: block;
    min-width: 0;
    padding: 0;
    border-bottom: 0;
    font-size: 14px;
}

.worker-hr-portal-fields .worker-hr-portal-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ido-portal-text-soft);
}

.worker-hr-portal-fields .worker-hr-portal-field-value {
    font-size: 14px;
    line-height: 1.45;
    color: var(--ido-portal-text);
}

@media (max-width: 575px) {
    .worker-hr-portal-fields { grid-template-columns: minmax(0, 1fr); }

    .worker-hr-portal-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .worker-hr-portal-tile:nth-child(n) { border-left: 1px solid var(--ido-portal-line); border-top: 0; }
    .worker-hr-portal-tile:nth-child(odd) { border-left: 0; }
    .worker-hr-portal-tile:nth-child(n + 3) { border-top: 1px solid var(--ido-portal-line); }

    .worker-hr-portal-summary-top { padding: 16px 16px 8px; }
    .worker-hr-portal-summary-status { padding: 0 16px 12px; }
    .worker-hr-portal-tabcard .horizontal-scrollable-tabs .horizontal-tabs .nav-tabs-horizontal { padding: 0 16px; gap: 20px; }

    .worker-hr-portal-avatar {
        width: 48px;
        height: 48px;
        font-size: 14px;
    }

    .worker-hr-portal-name {
        font-size: 20px;
    }
}

/* A long document title or category wraps in its cell instead of widening the table. */
.worker-hr-portal-table td {
    overflow-wrap: break-word;
}
