/* 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-home .ss-profile .ss-pf-hero {
  margin-bottom: 16px;
  padding: 14px 18px;
  gap: 16px;
}

.ss-home .ss-profile .ss-who {
  gap: 14px;
}

.ss-home .ss-profile .ss-avatar {
  width: 48px;
  height: 48px;
  font-size: 18px;
  font-weight: 700;
  color: #a76e41;
  background: #fdf6ec;
  border: 1.5px solid #da9e52;
  border-radius: 50%;
  box-shadow: none;
  overflow: hidden;
  flex: none;
}

.ss-home .ss-profile .ss-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ss-home .ss-profile .ss-pf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ss-home .ss-profile .ss-pf-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: #252525;
}

.ss-home .ss-profile .ss-pf-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.ss-home .ss-profile .ss-pf-job {
  color: #555555;
  font-size: 12.5px;
  font-weight: 600;
}

.ss-home .ss-profile .ss-pf-sub .ss-sep {
  margin: 0 2px;
  color: #b5b5b5;
}

.ss-home .ss-profile .ss-pf-name-en {
  color: #888888;
  font-size: 12px;
  unicode-bidi: isolate;
}

/* ---- 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;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1) !important;
  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: bold;
  color: #444;
  line-height: 1.5;
}

.ss-profile .ss-pf-val {
  unicode-bidi: plaintext;
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--field-line);
  border-radius: 4px;
  background: var(--field-ro);
  color: var(--ink);
  font-size: 13px;
  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;
  height: 28px;
  font-size: 12px;
  border-radius: 0;
  padding: 2px 6px;
  border: 1px solid #ced4da;
  box-shadow: none !important;
}

.ss-profile .form-control:focus {
  border-color: #da9e52;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.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-home .ss-profile .ss-pf-stats {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: none;
  background: #fdfaf6;
  border: 1px solid #f0dfca;
  border-radius: 6px;
  padding: 6px 4px;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat {
  min-width: 0;
  padding: 4px 16px;
  border: 0;
  border-inline-start: 1px solid #ede0cf;
  background: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat:first-child {
  border-inline-start: 0;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat-ic {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #f6ede0;
  color: #a76e41;
  display: grid;
  place-items: center;
  flex: none;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat.is-accent .ss-stat-ic {
  background: #eaf8f5;
  color: #26b99a;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat-ic svg {
  width: 17px;
  height: 17px;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat small {
  font-size: 11px;
  color: #737373;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat-val {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat-val b {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  color: #252525;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat.is-accent .ss-stat-val b {
  color: #1f8a70;
}

.ss-home .ss-profile .ss-pf-stats .ss-stat-val span {
  font-size: 11.5px;
  font-weight: 600;
  color: #666666;
}

.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: 8px;
  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;
}

/* ==========================================================================
   Responsive Architecture & Mobile-First Excellence for Profile & Documents
   ========================================================================== */

@media (max-width: 900px) {
  .ss-profile .ss-pf-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 768px) {

  /* --- Profile Hero on Mobile --- */
  .ss-home .ss-profile .ss-pf-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .ss-home .ss-profile .ss-who {
    gap: 12px;
  }

  .ss-home .ss-profile .ss-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .ss-home .ss-profile .ss-pf-name {
    font-size: 14.5px;
  }

  .ss-home .ss-profile .ss-pf-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 6px 2px;
  }

  .ss-home .ss-profile .ss-pf-stats .ss-stat {
    min-width: 0;
    padding: 4px 10px;
  }

  .ss-home .ss-profile .ss-pf-stats .ss-stat-val b {
    font-size: 14.5px;
  }

  /* --- Form Cards & Fields --- */
  .ss-profile .ss-pf-card {
    padding: 16px;
    border-radius: 8px;
  }

  .ss-profile .ss-pf-titlebar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .ss-profile .ss-pf-fields,
  .ss-profile .ss-pf-cols2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .ss-profile .ss-pf-val {
    min-height: 40px;
    font-size: 13.5px;
    padding: 8px 12px;
    border-radius: 8px;
  }

  .ss-profile .form-control {
    height: 28px;
    font-size: 12px;
    border-radius: 0;
    padding: 2px 6px;
  }

  .ss-profile .ss-pf-editbar {
    flex-wrap: wrap;
  }

  .ss-profile .ss-pf-editbar .ss-btn {
    width: 100%;
    min-height: 42px;
    border-radius: 8px;
  }

  /* --- Documents Section --- */
  .ss-profile .ss-pf-tablewrap {
    display: none;
  }

  .ss-profile .ss-pf-cards {
    display: block;
  }

  .ss-profile .ss-pf-summary {
    padding: 14px;
    border-radius: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .ss-profile .ss-pf-summary>.ss-btn {
    width: 100%;
    min-height: 44px;
    border-radius: 8px;
    font-weight: 700;
  }

  .ss-profile .ss-pf-counts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .ss-profile .ss-pf-count {
    padding: 8px;
    border-inline-start: 0;
    background: var(--field-ro);
    border-radius: 8px;
    text-align: center;
  }

  .ss-profile .ss-pf-count b {
    font-size: 20px;
  }

  .ss-profile .ss-pf-count small {
    font-size: 11px;
  }

  .ss-profile .ss-pf-doc {
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1) !important;
  }

  .ss-profile .ss-pf-docactions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding-top: 8px;
  }

  .ss-profile .ss-pf-docactions .ss-btn {
    width: 100%;
    min-height: 40px;
    border-radius: 8px;
  }

  .ss-profile .ss-pf-detail .ss-pf-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ss-profile .ss-pf-file {
    min-height: 44px;
    border-radius: 8px;
  }
}