/* Employee self service: my job file and my documents. Everything is scoped under .ss-profile, tokens and
   shared components (ss-card, ss-btn, ss-pill, ss-hero, ss-hint, ss-actionbar, ss-empty) come from self-service.css. */
.ss-profile { min-width: 0; }
.ss-profile .ss-alert, .ss-profile .ss-loading { margin-bottom: 16px; }

/* ---- hero ---- */
.ss-profile .ss-pf-hero { margin-bottom: 16px; }
.ss-profile .ss-avatar { overflow: hidden; }
.ss-profile .ss-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ss-profile .ss-pf-name { font-size: 20px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.ss-profile .ss-pf-name-en { color: var(--muted); font-size: 13.5px; text-align: start; }
html[dir="rtl"] .ss-profile .ss-pf-name-en { text-align: right; }
.ss-profile .ss-pf-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.ss-profile .ss-pf-job { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }

/* ---- job file cards ---- */
.ss-profile .ss-pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ss-profile .ss-pf-wide { grid-column: 1 / -1; }
.ss-profile .ss-pf-card { padding: 20px; min-width: 0; }
.ss-profile .ss-pf-title { margin: 0 0 16px; font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.ss-profile .ss-pf-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ss-profile .ss-pf-titlebar .ss-pf-title { margin: 0; }
.ss-profile .ss-pf-titlebar .ss-btn svg { width: 18px; height: 18px; }
.ss-profile .ss-pf-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.ss-profile .ss-pf-cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.ss-profile .ss-pf-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ss-profile .ss-pf-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.5; }
.ss-profile .ss-pf-val { unicode-bidi: plaintext; min-height: 44px; display: flex; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field-ro); color: var(--ink); font-size: 14.5px; overflow-wrap: anywhere; text-align: start; }
.ss-profile .ss-pf-card.is-editing { border-color: var(--brand); }
.ss-profile .ss-pf-form { margin: 0; }
.ss-profile .ss-pf-hint { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px 14px; font-size: 13.5px; }
.ss-profile .ss-pf-hint svg { width: 20px; height: 20px; margin-top: 2px; }
.ss-profile .ss-actionbar { margin-top: 8px; }

/* edit fields fill their column */
.ss-profile .ss-pf-form .form-group, .ss-profile .ss-pf-add .form-group { width: 100%; margin-inline: 0; }
.ss-profile np-textbox, .ss-profile np-select, .ss-profile np-date-picker, .ss-profile np-auto-size-text, .ss-profile np-checkbox, .ss-profile np-file { display: block; min-width: 0; }
.ss-profile .form-control { width: 100%; max-width: none; }
.ss-profile .ss-pf-add .ss-pf-title { margin-bottom: 16px; }

/* ---- documents summary ---- */
.ss-profile .ss-pf-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; margin-bottom: 16px; }
.ss-profile .ss-pf-counts { display: flex; align-items: center; gap: 0; min-width: 0; }
.ss-profile .ss-pf-count { padding-inline: 20px; border-inline-start: 1px solid var(--line); }
.ss-profile .ss-pf-count:first-child { padding-inline-start: 0; border-inline-start: 0; }
.ss-profile .ss-pf-count b { display: block; font-size: 24px; line-height: 1.2; color: var(--ink); }
.ss-profile .ss-pf-count small { display: block; color: var(--muted); font-size: 12.5px; }
.ss-profile .ss-pf-count.is-bad b, .ss-profile .ss-pf-count.is-bad small { color: var(--bad); }
.ss-profile .ss-pf-count.is-warn b, .ss-profile .ss-pf-count.is-warn small { color: var(--warn); }
.ss-profile .ss-pf-add { margin-bottom: 16px; }
.ss-profile .ss-empty { margin-top: 0; }

/* ---- documents table (wide) ---- */
.ss-profile .ss-pf-tablewrap { overflow: hidden; }
.ss-profile .ss-pf-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.ss-profile .ss-pf-table th { background: var(--bg); padding: 12px 16px; font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ss-profile .ss-pf-table td { unicode-bidi: plaintext; padding: 12px 16px; vertical-align: middle; text-align: start; color: var(--ink); }
.ss-profile .ss-pf-table tbody + tbody .ss-pf-row td { border-top: 1px solid var(--line); }
.ss-profile .ss-pf-row { cursor: pointer; }
.ss-profile .ss-pf-row:hover td { background: var(--bg); }
.ss-profile .ss-pf-detailrow > td { background: var(--bg); padding: 0; border-top: 1px solid var(--line); }
.ss-profile .ss-pf-narrow { width: 1%; white-space: nowrap; text-align: end; }
.ss-profile .ss-pf-type { display: inline-flex; align-items: center; gap: 10px; }
.ss-profile .ss-pf-type svg { width: 22px; height: 22px; color: var(--brand-ink); }
.ss-profile .ss-pf-type b { font-weight: 600; }
.ss-profile .ss-pf-note { display: block; margin-top: 2px; font-size: 12.5px; color: var(--st-pending); }
.ss-profile .ss-pf-note.is-bad { color: var(--bad); }
.ss-profile .ss-pf-caret { width: 16px; height: 16px; transition: transform .15s; }
.ss-profile tbody.open .ss-pf-caret, .ss-profile .ss-pf-more[aria-expanded="true"] .ss-pf-caret { transform: rotate(180deg); }
.ss-profile .ss-pf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- opened document ---- */
.ss-profile .ss-pf-detail { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.ss-profile .ss-pf-detail .ss-pf-fields { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ss-profile .ss-pf-detail .ss-pf-val { background: #fff; }
.ss-profile .ss-pf-nofiles { color: var(--muted); font-size: 13px; margin-top: 4px; }
.ss-profile .ss-pf-file { width: 100%; margin-top: 8px; background: #fff; font-family: inherit; color: var(--ink); text-align: start; cursor: pointer; }
.ss-profile .ss-pf-file:hover { border-color: var(--brand); }
.ss-profile .ss-pf-open { color: var(--brand-ink); font-weight: 600; font-size: 13.5px; flex: none; }
.ss-profile .ss-pf-mini { padding: 12px; font-size: 18px; }

/* ---- documents cards (phone) ---- */
.ss-profile .ss-pf-cards { display: none; }
.ss-profile .ss-pf-doc { padding: 16px; margin-bottom: 12px; }
.ss-profile .ss-pf-doc-hd { display: flex; align-items: flex-start; gap: 12px; }
.ss-profile .ss-pf-doc-main { flex: 1; min-width: 0; }
.ss-profile .ss-pf-doc-main b { display: block; font-weight: 700; line-height: 1.5; }
.ss-profile .ss-pf-doc-main small { display: block; color: var(--muted); font-size: 12.5px; }
.ss-profile .ss-pf-doc-hd .ss-pill { margin-top: 2px; }
.ss-profile .ss-pf-doc-meta { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ss-profile .ss-pf-doc-meta small { display: block; color: var(--muted); font-size: 12.5px; }
.ss-profile .ss-pf-doc-meta b { display: block; font-size: 15px; }
.ss-profile .ss-pf-more { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin-top: 12px; padding: 0; border: 0; border-top: 1px solid var(--line); background: none; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--brand-ink); cursor: pointer; }
.ss-profile .ss-pf-doc .ss-pf-detail { padding: 8px 0 0; }

/* ---- job file additions: stats, links, edit bar, photo ---- */
.ss-profile .ss-pf-stats { display: flex; align-items: stretch; gap: 0; flex: none; }
.ss-profile .ss-pf-stats .ss-stat { min-width: 140px; padding-inline: 24px; }
.ss-profile .ss-pf-editbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-height: 36px; }
.ss-profile .ss-pf-editbar .ss-btn svg { width: 18px; height: 18px; }
.ss-profile .ss-pf-editnote { color: var(--muted); font-size: 13.5px; }
.ss-profile .ss-pf-photo { margin-bottom: 16px; text-align: center; overflow: hidden; clear: both; }
.ss-profile .ss-pf-photo .control-group, .ss-profile .ss-pf-photo .uploader-container { float: none; width: auto; display: block; }
.ss-profile .ss-pf-photo .upImg { max-width: 160px; max-height: 160px; border-radius: 12px; object-fit: cover; }
.ss-profile .ss-pf-field.is-wide { grid-column: 1 / -1; }
.ss-profile .ss-pf-readonly { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ss-profile .ss-pf-jobfile { margin-top: 16px; }
.ss-profile .ss-pf-jobfile .ss-pf-file { margin-top: 0; }
.ss-profile .ss-pf-form { margin: 0; }
.ss-profile .ss-pf-form .ss-actionbar { margin-top: 16px; }
.ss-profile .ss-pf-form .form-group { margin-inline: 0; }

/* ---- documents grouped by type ---- */
.ss-profile .ss-pf-group { margin-bottom: 20px; }
.ss-profile .ss-pf-grouptitle { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.ss-profile .ss-pf-grouptitle svg { width: 22px; height: 22px; color: var(--brand-ink); }
.ss-profile .ss-pf-grouptitle small { color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 1px 10px; border-radius: 999px; background: var(--field-ro); }
.ss-profile .ss-pf-current { margin-inline-start: 8px; }
.ss-profile .ss-pf-docactions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.ss-profile .ss-pf-docactions .ss-btn svg { width: 16px; height: 16px; }
.ss-profile .ss-pf-doc-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-start; }

@media (max-width: 900px) {
  .ss-profile .ss-pf-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .ss-profile .ss-pf-tablewrap { display: none; }
  .ss-profile .ss-pf-cards { display: block; }
}
@media (max-width: 560px) {
  .ss-profile .ss-pf-card { padding: 16px; }
  .ss-profile .ss-pf-fields, .ss-profile .ss-pf-cols2 { grid-template-columns: minmax(0, 1fr); }
  .ss-profile .ss-pf-fields { gap: 12px; }
  .ss-profile .ss-pf-name { font-size: 17px; }
  .ss-profile .ss-pf-stats { width: 100%; flex-direction: column; }
  .ss-profile .ss-pf-stats .ss-stat { padding-inline: 0; }
  .ss-profile .ss-pf-summary { padding: 14px 16px; flex-wrap: wrap; }
  .ss-profile .ss-pf-summary > .ss-btn { width: 100%; }
  .ss-profile .ss-pf-count { padding-inline: 14px; }
}
