/* Spark Agency HR — saved papers (v54) */
@media screen {
  .fm-switch { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 14px; background: #e8f0ef; }
  .fm-switch button { flex: 1; padding: 9px 10px; border-radius: 10px; background: transparent; color: #33505a; box-shadow: none; font-weight: 650; display: inline-flex; justify-content: center; gap: 6px; align-items: center; }
  .fm-switch button[aria-selected="true"] { background: #fff; color: #0b6466; box-shadow: 0 2px 8px #0f2a3614; }
  .fm-count { background: #0a9a9c; color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 11.5px; }

  .pp-head { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
  .pp-head h2 { margin: 0 0 4px; }
  .pp-head p { margin: 0; max-width: 62ch; }
  .pp-head input { max-width: 260px; }
  .pp-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
  .pp-tabs button { background: #fff; color: #33505a; border: 1px solid #dbe6e5; box-shadow: none; border-radius: 99px; padding: 7px 14px; font-weight: 650; }
  .pp-tabs button span { color: #7b9096; font-weight: 600; margin-inline-start: 3px; }
  .pp-tabs button[aria-selected="true"] { background: #0f2a36; color: #fff; border-color: #0f2a36; }
  .pp-tabs button[aria-selected="true"] span { color: #9fd8d6; }
  .pp-rows { display: grid; gap: 8px; }
  .pp-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; padding: 14px 16px; background: #fff; color: inherit; border: 1px solid #dfe8e7; border-radius: 16px; box-shadow: none; font-weight: 400; transition: border-color 0.15s, transform 0.15s; }
  .pp-row:hover { border-color: #0a9a9c; transform: translateY(-1px); background: #fff; }
  .pp-row.is-mine { border-color: #f0c77a; background: #fffaf0; }
  .pp-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: #e6f4f2; color: #087f81; }
  .pp-row.is-mine .pp-ico { background: #fdecc8; color: #a5620a; }
  .pp-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
  .pp-main b { overflow-wrap: anywhere; }
  .pp-main small { color: #6e858c; }
  .pp-people { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
  .pp-people span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #f0f4f4; color: #4f666d; }
  .pp-people .is-done { background: #e2f5ec; color: #157a4a; }
  .pp-people .is-wait { background: #fdf1dc; color: #9a5b07; }
  .pp-badge { flex: none; display: inline-block; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
  .pp-badge.is-ok { background: #def4e8; color: #157a4a; }
  .pp-badge.is-warn { background: #fdecc8; color: #8a5206; }
  .pp-badge.is-muted { background: #eef2f2; color: #5b7178; }
  .pp-empty { padding: 30px; text-align: center; }

  dialog.pp-dialog { width: min(1180px, calc(100vw - 24px)); height: min(92vh, 980px); max-height: none; padding: 0; border: 0; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; }
  dialog.pp-dialog:not([open]) { display: none; }
  dialog.pp-dialog::backdrop { background: #0b1d2499; }
  .pp-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #e3eceb; background: #fff; }
  .pp-title { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
  .pp-title > div { min-width: 0; }
  .pp-title h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
  .pp-by { color: #6e858c; font-size: 13px; letter-spacing: 0; text-transform: none; margin-inline-end: 6px; }
  .pp-title .pp-badge { vertical-align: middle; margin-top: 4px; }
  .pp-close { background: #f0f4f4; color: #33505a; box-shadow: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
  .pp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; background: #eef3f3; }
  .pp-paper { overflow: auto; padding: 18px; min-width: 0; }
  .pp-paper .sp-preview { width: 100%; overflow: hidden; }
  .pp-listbody { overflow: auto; padding: 18px; background: #f3f7f7; flex: 1; }
  .pp-side small, .pp-side p { letter-spacing: 0; text-transform: none; }
  .pp-side { overflow: auto; padding: 14px; display: grid; align-content: start; gap: 12px; background: #f7faf9; border-inline-start: 1px solid #e3eceb; }
  .pp-card { background: #fff; border: 1px solid #e0e9e8; border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
  .pp-card h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 7px; }
  .pp-card p { margin: 0; }
  .pp-small { font-size: 12.5px; }
  .pp-signbox { border-color: #f0c77a; background: #fffaf0; }
  .pp-pad { width: 100%; height: auto; aspect-ratio: 600 / 220; background: #fff; border: 2px dashed #e0b866; border-radius: 12px; touch-action: none; cursor: crosshair; }
  .pp-row-btns, .pp-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .pp-plist, .pp-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .pp-plist li { display: flex; align-items: center; gap: 9px; }
  .pp-plist li > span:nth-child(2) { flex: 1; display: grid; }
  .pp-plist small, .pp-files small { color: #6e858c; font-size: 12px; }
  .pp-dot { width: 10px; height: 10px; border-radius: 50%; background: #c9d6d5; flex: none; }
  .pp-dot.is-done { background: #23a26a; }
  .pp-dot.is-wait { background: #e5a23a; }
  .pp-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .pp-files li small { width: 100%; }
  .pp-upload span { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border-radius: 12px; border: 1px dashed #9ccfcd; color: #0b6466; font-weight: 650; cursor: pointer; }
  .pp-upload span:hover { background: #f0faf9; }
  .pp-lock { display: inline-flex; align-items: center; gap: 6px; color: #6e858c; font-size: 13px; }
  .pp-del { color: #b3262f !important; }
  .pp-log ul { margin: 6px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 13px; }
  .pp-editing .sp-box[contenteditable] { outline: 2px solid #8fd3d1; }
  .sp-locked .sp-check { pointer-events: none; }
  .sp-sg .sp-box.sp-signed { display: grid; place-items: center; position: relative; overflow: hidden; }
  .sp-sg .sp-box.sp-signed img { max-width: 92%; max-height: 70%; object-fit: contain; }
  .sp-sg .sp-box.sp-signed small { position: absolute; bottom: 2px; inset-inline: 6px; font-size: 8px; color: #5b6f78; text-align: center; }

  dialog.pp-send { width: min(680px, calc(100vw - 24px)); }
  .pp-picks { max-height: 50vh; overflow: auto; display: grid; gap: 6px; padding: 2px; }
  .pp-picks h3 { margin: 8px 0 2px; font-size: 12.5px; color: #5b7178; }
  .pp-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; border: 1px solid #e0e9e8; border-radius: 12px; }
  .pp-pick.is-on { border-color: #0a9a9c; background: #f0faf9; }
  .pp-pick select { width: auto; flex: none; padding: 6px 8px; font-size: 13px; }
  .pp-pick:not(.is-on) select { opacity: 0.45; }
  label.pp-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px; font-weight: 500; }
  label.pp-who input { width: auto; margin: 0; }
  label.pp-who span { display: grid; }
  label.pp-who small { color: #6e858c; }

  .pp-portal { margin-bottom: 18px; }
  .pp-portal-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
  .pp-portal h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 18px; }
  .pp-portal p { margin: 4px 0 12px; }

  @media (max-width: 860px) {
    dialog.pp-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
    .pp-body { grid-template-columns: 1fr; overflow: auto; }
    .pp-paper, .pp-side { overflow: visible; }
    .pp-side { border: 0; }
    .pp-row { flex-wrap: wrap; }
    .pp-paper { padding: 10px; }
    .pp-title h2 { font-size: 16px; }
  }
}
@media screen {
  .sp-signs { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; padding-top: 10px; border-top: 1px solid #c9d6e6; }
  .sp-sign { display: grid; justify-items: center; gap: 2px; min-width: 150px; }
  .sp-sign img { height: 46px; max-width: 180px; object-fit: contain; }
  .sp-sign span { font-size: 11px; font-weight: 700; color: #1d3b5c; }
  .sp-sign small { font-size: 9px; color: #5b6f78; }
}
@media print {
  .sp-signs { display: flex; flex-wrap: wrap; gap: 3mm 6mm; margin-top: 4mm; padding-top: 3mm; border-top: 0.3mm solid #c9d6e6; }
  .sp-sign { display: grid; justify-items: center; min-width: 40mm; }
  .sp-sign img { height: 12mm; max-width: 50mm; }
  .sp-sign span { font-size: 8pt; font-weight: 700; }
  .sp-sign small { font-size: 6pt; }
  .sp-sg .sp-box.sp-signed { display: grid; place-items: center; position: relative; }
  .sp-sg .sp-box.sp-signed img { max-width: 92%; max-height: 70%; }
  .sp-sg .sp-box.sp-signed small { position: absolute; bottom: 1mm; left: 2mm; right: 2mm; font-size: 6pt; text-align: center; }
}
@media screen {
  .pp-badge.is-bad { background: #fde4e6; color: #a3212b; }
  .pp-mark { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #eef3f3; }
  .pp-mark button { flex: 1; padding: 8px 6px; border-radius: 9px; background: transparent; color: #33505a; box-shadow: none; font-weight: 650; font-size: 13px; }
  .pp-mark button[aria-pressed="true"] { background: #fff; color: #0b6466; box-shadow: 0 2px 8px #0f2a3614; }
  .pp-mark button[data-mark="not_signed"][aria-pressed="true"] { color: #a3212b; }
  dialog.pp-ask { width: min(460px, calc(100vw - 24px)); }
  .pp-ask-btns { display: grid; gap: 8px; }
}
