/* Self service request screens: new request, my requests, request detail and the manager inbox.
   The shared components (cards, buttons, badges, chips, list rows, dialog, stepper, action bar) live in self-service.css.
   Only what is specific to these four screens is here, plus the ERP control fixes for the request form. */

/* small helpers other self service screens also use */
.ss-home .ss-muted { color: var(--muted); }
.ss-home .ss-small { font-size: 12.5px; }
.ss-home .ss-mt { margin-top: 10px; }
.ss-home .ss-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ss-home .ss-grow { flex: 1; }
.ss-home .ss-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.ss-home .ss-star { color: var(--bad); }
.ss-home .ss-error { color: var(--bad); font-size: 12.5px; margin-top: 4px; }

/* colored icon tiles used by the document status on the profile */
.ss-page .c-wa { background: var(--st-pending-bg); color: var(--st-pending); }
.ss-page .c-or, .ss-page .c-vi, .ss-page .c-te, .ss-page .c-pi { background: var(--brand-soft); color: var(--brand-ink); }
.ss-page .c-in { background: var(--st-review-bg); color: var(--st-review); }
.ss-page .c-ok { background: var(--st-approved-bg); color: var(--st-approved); }
.ss-home .ss-ic { width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center; flex: none; }
.ss-home .ss-ic svg { width: 22px; height: 22px; }

/* =========================================================================== request form */
.ss-home .ss-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px 20px; align-items: start; }
.ss-home .ss-form-grid .ss-main { grid-column: 1; grid-row: 1; min-width: 0; }
.ss-home .ss-form-grid .ss-side { grid-column: 2; grid-row: 1 / span 2; }
.ss-home .ss-form-bar { grid-column: 1; grid-row: 2; justify-content: flex-start; margin: 0; padding: 0; border-top: 0; }
.ss-home .ss-form-bar .ss-btn { min-width: 140px; }
.ss-home .ss-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ss-home .ss-side .ss-card > b:first-child { display: block; font-size: 15.5px; margin-bottom: 8px; color: var(--ink); }

/* two column field grid. The ERP controls bring bootstrap rows and columns: the rows disappear and the columns become grid cells */
.ss-home.ss-page .ss-ff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
.ss-home.ss-page .ss-ff > .row { display: contents; margin: 0; }
.ss-home.ss-page .ss-ff > .row::before, .ss-home.ss-page .ss-ff > .row::after { display: none; }
.ss-home.ss-page .ss-ff > .row > [class*="col-"] { float: none; width: auto; min-width: 0; padding: 0; margin: 0; }
.ss-home.ss-page .ss-ff > .row > .col-xs-12:not(.col-sm-6), .ss-home.ss-page .ss-ff > .row > .ss-ff-full { grid-column: 1 / -1; }
.ss-home.ss-page .ss-ff > .ss-note { grid-column: 1 / -1; }
.ss-home.ss-page .ss-ff .ss-ff-check { grid-column: 1 / -1; display: flex; align-items: center; min-height: 44px; margin-bottom: 16px; }
.ss-home.ss-page .ss-ff .ss-ff-check label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.ss-home.ss-page .ss-ff .ss-ff-check .control-group, .ss-home.ss-page .ss-ff .ss-ff-check .checkbox { margin: 0; }
.ss-home.ss-page .ss-ff .form-control { width: 100%; max-width: 100%; }
.ss-home.ss-page .ss-ff .form-group { margin-bottom: 16px; }
.ss-home.ss-page .ss-ff textarea.form-control { min-height: 110px; }
.ss-home.ss-page .ss-ff .ss-note { margin: 0 0 16px; font-size: 13px; }

/* date picker: full width input, the calendar icon sits inside the field end, no grey box */
.ss-home.ss-page .ss-ff .date-picker { position: relative; width: 100%; }
.ss-home.ss-page .ss-ff .date-picker .input-group { display: block; position: relative; width: 100%; }
.ss-home.ss-page .ss-ff .date-picker .form-control { width: 100%; padding-inline: 12px 44px; border-radius: 12px; }
.ss-home.ss-page .ss-ff .date-picker .input-group-addon { position: absolute; inset-block: 0; inset-inline-end: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink-2); display: grid; place-items: center; z-index: 3; pointer-events: none; }
.ss-home.ss-page .ss-ff .date-picker.read-only .input-group-addon { color: var(--muted); cursor: default; }

/* time picker: HH : MM and the AM/PM button in one row, every part sized like a field */
.ss-home.ss-page .ss-ff .form-group > div:has(.pm-am) { display: flex; align-items: center; gap: 8px; }
.ss-home.ss-page .ss-ff .form-group > div:has(.pm-am) > div { display: flex; flex: 1; min-width: 0; direction: ltr; flex-direction: row-reverse; align-items: center; justify-content: flex-end; gap: 8px; }
.ss-home.ss-page .ss-ff .form-group > div:has(.pm-am) > div > span { float: none !important; color: var(--ink-2); font-weight: 700; }
.ss-home.ss-page .ss-ff .form-group > div:has(.pm-am) input.form-control { flex: 1; min-width: 0; width: auto !important; float: none; height: 44px; padding: 0 8px; font-size: 14.5px !important; text-align: center !important; border: 1px solid var(--field-line) !important; border-radius: 12px; }
.ss-home.ss-page .ss-ff .pm-am { flex: none; min-width: 56px; height: 44px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 12px; background: #fff; color: var(--ink); font-family: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.ss-home.ss-page .ss-ff .pm-am:hover { background: var(--brand-soft); border-color: var(--brand); }

/* side panel */
.ss-home .ss-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ss-home .ss-side .ss-card > b:first-child + .ss-line { border-top: 0; }
.ss-home .ss-line b { font-weight: 700; }
.ss-home .ss-balance { margin-top: 8px; padding: 10px 12px; background: var(--brand-soft); border-radius: 12px; }
.ss-home .ss-line0 { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ss-home .ss-neg { color: var(--bad); }
.ss-home .ss-money { font-size: 26px; font-weight: 700; color: var(--ink); margin: 8px 0 2px; line-height: 1.3; }
.ss-home .ss-money small { font-size: 13px; color: var(--muted); font-weight: 400; }
.ss-home .ss-hint { display: flex; gap: 10px; padding: 12px 14px; font-size: 12.5px; margin-top: 14px; }
.ss-home .ss-hint svg { width: 20px; height: 20px; }
.ss-home .ss-hint-warn { margin-top: 0; margin-bottom: 14px; }
.ss-home .ss-path { margin-top: 12px; }
.ss-home .ss-step-text { display: flex; flex-direction: column; min-width: 0; padding-top: 3px; }

/* attachment: the shared upload zone and file chip, built over the ERP file control */
.ss-home .ss-attach { margin-top: 4px; }
.ss-home.ss-page .ss-file .single-file { display: flex; flex-direction: column; gap: 10px; text-align: start; }
html body .ss-home.ss-page .ss-file .btn-upload.btn.btn-info { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 96px; padding: 20px 16px; border: 1px dashed var(--field-line); border-radius: 12px; background: #fff; box-shadow: none; color: var(--ink-2); font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; white-space: normal; text-align: center; cursor: pointer; }
html body .ss-home.ss-page .ss-file .btn-upload.btn.btn-info:hover, html body .ss-home.ss-page .ss-file .btn-upload.btn.btn-info:focus { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); outline: 0; }
html body .ss-home.ss-page .ss-file .btn-upload.btn.btn-info .fa { font-size: 26px; color: var(--brand-ink); }
.ss-home.ss-page .ss-file .btn-upload.disabled { pointer-events: none; opacity: .5; }
.ss-home.ss-page .ss-file .file-info { display: none; }
.ss-home.ss-page .ss-file .file-info:has(.file-name a:not(:empty)) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field-ro); }
.ss-home.ss-page .ss-file .file-info:has(.file-name a:not(:empty))::before { content: "\f016"; font-family: FontAwesome; font-size: 20px; color: var(--brand-ink); order: -1; }
.ss-home.ss-page .ss-file .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-home.ss-page .ss-file .file-name a { color: var(--ink); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.ss-home.ss-page .ss-file .file-size, .ss-home.ss-page .ss-file .percentage { color: var(--muted); font-size: 12px; }
.ss-home.ss-page .ss-file .progress { flex-basis: 100%; order: 9; height: 4px; margin: 0; border-radius: 99px; background: var(--line); box-shadow: none; }
.ss-home.ss-page .ss-file .progress-bar { background: var(--brand); box-shadow: none; }
.ss-home.ss-page .ss-file .actions { flex: none; }
.ss-home.ss-page .ss-file .actions a.delete { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); text-decoration: none; }
.ss-home.ss-page .ss-file .actions a.delete:hover { background: var(--bad-soft); color: var(--bad); }

/* =========================================================================== my requests and inbox */
.ss-home .ss-kind-select { min-width: 160px; }
.ss-home .ss-reqlist .ss-row { min-height: 72px; }
.ss-home .ss-req-status { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: none; width: 190px; }
.ss-home .ss-req-status small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.ss-home .ss-row-main > small { overflow-wrap: anywhere; }
.ss-home .ss-ib { cursor: default; }
.ss-home .ss-ib:hover { background: none; }
.ss-home .ss-ib-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; }
.ss-home .ss-ib-main { flex: 1; min-width: 0; text-align: start; background: none; border: 0; padding: 0; font-family: inherit; color: var(--ink); cursor: pointer; display: block; }
.ss-home .ss-ib-main b { display: block; font-weight: 700; }
.ss-home .ss-ib-main small { display: block; color: var(--muted); font-size: 12.5px; }
.ss-home .ss-ib-main:hover b { color: var(--brand-ink); }
.ss-home .ss-ib-kind { display: flex !important; align-items: center; gap: 6px; }
.ss-home .ss-ib-kind svg { width: 16px; height: 16px; color: var(--brand-ink); }
.ss-home .ss-ib-status { flex: none; }

/* =========================================================================== request detail */
.ss-home .ss-detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px 20px; align-items: start; }
.ss-home .ss-detail .ss-detail-main { grid-column: 1; grid-row: 1; min-width: 0; }
.ss-home .ss-detail .ss-detail-side { grid-column: 2; grid-row: 1 / span 2; }
.ss-home .ss-detail-bar { grid-column: 1; grid-row: 2; justify-content: flex-start; align-items: center; flex-wrap: wrap; margin: 0; padding: 0; border-top: 0; }
.ss-home .ss-detail-bar .ss-bar-hint { flex: 1; min-width: 200px; text-align: end; }
.ss-home .ss-head { display: flex; align-items: center; gap: 12px; }
.ss-home .ss-head-ic { width: 48px; height: 48px; }
.ss-home .ss-head-text { flex: 1; min-width: 0; }
.ss-home .ss-head-text h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.ss-home .ss-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.ss-home .ss-kv > div { background: none; padding: 0; min-width: 0; }
.ss-home .ss-kv small { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.ss-home .ss-kv b, .ss-home .ss-readbox { display: block; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field-ro); color: var(--ink); font-weight: 500; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.ss-home .ss-detail-sec { margin-top: 18px; }
.ss-home .ss-detail-sec .ss-filechip + .ss-filechip { margin-top: 8px; }
.ss-home .ss-filechip { background: #fff; }
.ss-home .ss-filechip-size { direction: ltr; unicode-bidi: isolate; }
.ss-home .ss-side-title { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--ink); }

/* reject dialog */
.ss-home .ss-dialog-x { width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.ss-home .ss-dialog-x:hover { background: var(--field-ro); }
.ss-home .ss-dialog-sub { margin: 0 0 16px; color: var(--ink-2); }
.ss-home .ss-textarea { display: block; width: 100%; min-height: 110px; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 12px; background: #fff; color: var(--ink); font-family: inherit; font-size: 14.5px; resize: vertical; }
.ss-home .ss-textarea:focus { border-color: var(--brand); box-shadow: var(--ring); outline: 0; }
.ss-home .ss-textarea.invalid { border-color: var(--bad); }
.ss-home .ss-alert a { color: var(--brand-ink); }

/* =========================================================================== small screens */
@media (max-width: 900px) {
  .ss-home .ss-form-grid, .ss-home .ss-detail { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .ss-home .ss-form-grid .ss-side, .ss-home .ss-detail .ss-detail-side { order: 2; }
  .ss-home .ss-form-bar, .ss-home .ss-detail-bar { order: 3; }
  .ss-home .ss-detail-bar .ss-bar-hint { flex-basis: 100%; text-align: start; }
}
@media (max-width: 700px) {
  .ss-home .ss-kind-select { width: 100%; }
  .ss-home .ss-reqlist { border: 0; background: none; overflow: visible; }
  .ss-home .ss-reqlist .ss-row { flex-wrap: wrap; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; }
  .ss-home .ss-reqlist .ss-row:first-child { border-top: 1px solid var(--line); }
  .ss-home .ss-reqlist .ss-row > .ss-chev { order: 1; }
  .ss-home .ss-req-status { order: 2; width: 100%; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; padding-top: 10px; border-top: 1px solid var(--line); }
  .ss-home .ss-ib .ss-ib-main { flex: 1 1 140px; }
  .ss-home .ss-ib .ss-btn { flex: 1 1 140px; }
  .ss-home .ss-kv { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ss-home.ss-page .ss-ff { grid-template-columns: 1fr; }
  .ss-home .ss-form-bar, .ss-home .ss-detail-bar { margin: 0 -16px -16px; flex-wrap: wrap; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
  .ss-home .ss-form-bar .ss-btn { min-width: 0; }
  .ss-home .ss-detail-bar .ss-btn { flex: 1 1 40%; }
  .ss-home .ss-detail-bar .ss-bar-hint { display: none; }
  .ss-home .ss-dialog { max-height: 92vh; overflow: auto; }
}
