/* ==========================================================================
   css/iba-approvals.css — 14.0.0 patch 5
   Approve / reject dialog, decision toast, Approved / Rejected rows,
   and the ESN print stamps (several approvals side by side).
   ========================================================================== */

/* ---------- Dialog ---------- */
.iba-apd {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 12, 22, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-family: inherit;
}
.iba-apd.hidden { display: none !important; }
.iba-apd-box {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ui-line, rgba(255,255,255,.14));
  border-radius: var(--ui-radius-l, 16px);
  background: linear-gradient(180deg, rgba(20, 42, 62, 0.97), rgba(13, 25, 39, 0.98));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  color: var(--ui-text, #EEF3F8);
}
.iba-apd-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--ui-line-soft, rgba(255,255,255,.07));
}
.iba-apd-kicker {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--ui-gold, #E3C98A);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.iba-apd-head h3 {
  margin: 0;
  color: var(--ui-text, #EEF3F8);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}
.iba-apd-x {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ui-line, rgba(255,255,255,.14));
  border-radius: 10px;
  background: transparent;
  color: var(--ui-text-2, #A7B6C6);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.iba-apd-x:hover { color: var(--ui-text, #EEF3F8); background: rgba(255,255,255,.06); }
.iba-apd-body { padding: 16px 20px 6px; overflow: auto; }
.iba-apd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.iba-apd-grid > div {
  padding: 9px 11px;
  border: 1px solid var(--ui-line-soft, rgba(255,255,255,.07));
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  min-width: 0;
}
.iba-apd-grid small {
  display: block;
  margin-bottom: 3px;
  color: var(--ui-text-3, #7F90A3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.iba-apd-grid strong {
  display: block;
  color: var(--ui-text, #EEF3F8);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.iba-apd-slots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  margin-bottom: 14px;
}
.iba-apd-slots small { margin-right: 4px; color: var(--ui-text-2, #A7B6C6); font-size: 12px; font-weight: 600; }
.iba-apd-slot, .iba-apd-slot-load {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px dashed var(--ui-line, rgba(255,255,255,.14));
  border-radius: 999px;
  color: var(--ui-text-3, #7F90A3);
  font-size: 11.5px;
}
.iba-apd-slot.is-used { border-style: solid; border-color: rgba(95, 211, 160, .45); color: var(--ui-green, #5FD3A0); background: rgba(95, 211, 160, .08); }
.iba-apd-slot.is-ceo { border-style: solid; border-color: rgba(227, 201, 138, .5); color: var(--ui-gold, #E3C98A); background: var(--ui-gold-soft, rgba(227,201,138,.14)); }
.iba-apd-slot-load { border: 0; padding-left: 0; }
.iba-apd label {
  display: block;
  margin-bottom: 6px;
  color: var(--ui-text-2, #A7B6C6);
  font-size: 12px;
  font-weight: 600;
}
.iba-apd label span { color: var(--ui-text-3, #7F90A3); font-weight: 500; }
.iba-apd textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 78px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--ui-line, rgba(255,255,255,.14));
  border-radius: 10px;
  background: var(--ui-field, rgba(14,27,42,.62));
  color: var(--ui-text, #EEF3F8);
  font: inherit;
  font-size: 13.5px;
  outline: none;
}
.iba-apd textarea::placeholder { color: var(--ui-text-3, #7F90A3); }
.iba-apd textarea:focus { border-color: var(--ui-teal, #138A97); box-shadow: 0 0 0 3px var(--ui-teal-soft, rgba(19,138,151,.18)); }
.iba-apd-error { min-height: 18px; margin: 8px 0 4px; color: var(--ui-red, #EF8A7A); font-size: 12.5px; font-weight: 600; }
.iba-apd-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--ui-line-soft, rgba(255,255,255,.07));
}
.iba-apd-spacer { flex: 1; }
.iba-apd-pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ui-blue, #7DB7F0) !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
}
.iba-apd-pdf:hover { text-decoration: underline !important; }
.iba-apd-pdf.hidden { display: none !important; }
.iba-apd-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.iba-apd-btn:disabled { opacity: .5; cursor: not-allowed; }
.iba-apd-btn.is-approve { background: var(--ui-teal, #138A97); color: #fff; }
.iba-apd-btn.is-approve:not(:disabled):hover { background: var(--ui-teal-hover, #17A0AE); }
.iba-apd-btn.is-reject { border-color: rgba(239, 138, 122, .55); background: transparent; color: var(--ui-red, #EF8A7A); }
.iba-apd-btn.is-reject:not(:disabled):hover { background: var(--ui-red-soft, rgba(239,138,122,.14)); }

@media (max-width: 600px) {
  .iba-apd { align-items: flex-end; padding: 0; }
  .iba-apd-box { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .iba-apd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iba-apd-foot { flex-wrap: wrap; }
  .iba-apd-btn { flex: 1 1 40%; justify-content: center; }
}

/* ---------- Toast ---------- */
#iba-apv-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 2147482600;
  transform: translate(-50%, 140%);
  transition: transform .28s ease;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
#iba-apv-toast.is-open { transform: translate(-50%, 0); pointer-events: auto; }
.iba-apv-toast-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 44px 12px 16px;
  position: relative;
  border: 1px solid var(--ui-line, rgba(255,255,255,.14));
  border-left: 3px solid var(--ui-teal, #138A97);
  border-radius: 12px;
  background: rgba(13, 25, 39, 0.96);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  color: var(--ui-text, #EEF3F8);
  font-size: 13.5px;
}
.iba-apv-toast-body.ok { border-left-color: var(--ui-green, #5FD3A0); }
.iba-apv-toast-body.warn { border-left-color: var(--ui-amber, #F2C14E); }
.iba-apv-toast-body code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  color: var(--ui-gold, #E3C98A);
  font-size: 12.5px;
}
.iba-apv-toast-sub { color: var(--ui-text-2, #A7B6C6); font-size: 12.5px; }
.iba-apv-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(37, 211, 102, .45);
  border-radius: 999px;
  background: rgba(37, 211, 102, .12);
  color: #8CF0B4;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.iba-apv-toast-x {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ui-text-2, #A7B6C6);
  font-size: 18px;
  cursor: pointer;
}

/* ---------- Active Task: Print on an approved row ---------- */
.iba-apv-print-btn { margin-right: 6px; }

/* ---------- Print: several approvals side by side ---------- */
.iba-approval-stamp-stack {
  position: absolute;
  left: 50%;
  bottom: 28mm;
  transform: translateX(-50%);
  width: 196mm;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 4mm 5mm;
}
.iba-approval-stamp-stack .iba-approval-stamp {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
}
