/* faadumo54: "Pay by" date for debts + the red alert once that date arrives. */

/* ---- Insert / Edit Sale: date under "Customer Has Debt" ---- */
.alpha-debt-date { display: grid; gap: 0.35rem; }
.alpha-debt-date-label { font-size: 0.75rem; font-weight: 700; color: rgb(51 65 85); }
.dark .alpha-debt-date-label { color: rgb(203 213 225); }
.alpha-debt-date-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.alpha-debt-date-input {
  flex: 1 1 10rem;
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: #fff;
  color: rgb(15 23 42);
}
.alpha-debt-date-input:focus { outline: none; box-shadow: 0 0 0 2px rgb(239 68 68); }
.alpha-debt-date-input[aria-invalid="true"] { border-color: rgb(220 38 38); background: rgb(254 242 242); }
.dark .alpha-debt-date-input { background: rgb(30 41 59); border-color: rgb(51 65 85); color: #fff; color-scheme: dark; }
.dark .alpha-debt-date-input[aria-invalid="true"] { border-color: rgb(248 113 113); background: rgb(69 10 10 / 0.5); }
.alpha-debt-quick {
  padding: 0.4rem 0.6rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgb(71 85 105);
  background: #fff;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.alpha-debt-quick:hover { border-color: rgb(252 165 165); color: rgb(185 28 28); }
.alpha-debt-quick.on { background: rgb(220 38 38); border-color: rgb(185 28 28); color: #fff; }
.dark .alpha-debt-quick { background: rgb(30 41 59); border-color: rgb(51 65 85); color: rgb(203 213 225); }
.dark .alpha-debt-quick.on { background: rgb(220 38 38); border-color: rgb(220 38 38); color: #fff; }
.alpha-debt-date-hint { margin: 0; font-size: 0.7rem; color: rgb(100 116 139); }
.alpha-debt-date-hint.late { color: rgb(220 38 38); font-weight: 700; }
.alpha-debt-date-err { margin: 0; font-size: 0.7rem; font-weight: 700; color: rgb(220 38 38); }
.dark .alpha-debt-date-hint { color: rgb(148 163 184); }
.dark .alpha-debt-date-hint.late, .dark .alpha-debt-date-err { color: rgb(248 113 113); }

/* ---- red alert above the sales table ---- */
.alpha-debt-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgb(254 202 202);
  border-left: 4px solid rgb(220 38 38);
  background: linear-gradient(90deg, rgb(254 226 226), rgb(254 242 242));
  color: rgb(153 27 27);
  animation: alpha-debt-in 0.35s ease-out both;
}
.dark .alpha-debt-alert { background: linear-gradient(90deg, rgb(127 29 29 / 0.55), rgb(69 10 10 / 0.35)); border-bottom-color: rgb(127 29 29); color: rgb(254 202 202); }
.alpha-debt-alert-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: rgb(220 38 38);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 900;
  box-shadow: 0 0 0 0 rgb(220 38 38 / 0.5);
  animation: alpha-debt-ping 2s ease-out infinite;
}
.alpha-debt-alert-body { flex: 1; min-width: 0; display: grid; gap: 0.35rem; }
.alpha-debt-alert-title { font-size: 0.8rem; font-weight: 800; }
.alpha-debt-alert-title strong { font-weight: 900; color: rgb(185 28 28); }
.dark .alpha-debt-alert-title strong { color: #fff; }
.alpha-debt-alert-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.alpha-debt-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgb(252 165 165);
  border-radius: 999px;
  background: #fff;
  font-size: 0.7rem;
  color: rgb(127 29 29);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.alpha-debt-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgb(220 38 38 / 0.2); }
.alpha-debt-chip .n { font-weight: 700; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alpha-debt-chip .a { font-weight: 900; color: rgb(220 38 38); font-variant-numeric: tabular-nums; }
.alpha-debt-chip .w { padding: 0 0.35rem; border-radius: 999px; background: rgb(220 38 38); color: #fff; font-size: 0.6rem; font-weight: 900; text-transform: uppercase; }
.dark .alpha-debt-chip { background: rgb(15 23 42); border-color: rgb(153 27 27); color: rgb(254 202 202); }
.dark .alpha-debt-chip .a { color: rgb(252 165 165); }
.alpha-debt-more { align-self: center; font-size: 0.7rem; font-weight: 800; }
.alpha-debt-show {
  flex: none;
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 0.6rem;
  background: rgb(220 38 38);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}
.alpha-debt-show:hover { background: rgb(185 28 28); }
@media (max-width: 640px) {
  .alpha-debt-alert { flex-wrap: wrap; padding: 0.6rem 0.75rem; }
  .alpha-debt-alert-body { flex-basis: calc(100% - 2.7rem); }
  .alpha-debt-show { margin-left: 2.65rem; }
}
@keyframes alpha-debt-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes alpha-debt-ping { 0% { box-shadow: 0 0 0 0 rgb(220 38 38 / 0.45); } 70%, 100% { box-shadow: 0 0 0 8px rgb(220 38 38 / 0); } }
@media (prefers-reduced-motion: reduce) { .alpha-debt-alert, .alpha-debt-alert-icon { animation: none; } }

/* ---- faadumo56: big message when a debt is saved (top centre, 9 s) ---- */
.alpha-debt-notice {
  position: fixed;
  z-index: 75;
  top: 18px;
  left: 50%;
  width: min(440px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 18px;
  overflow: hidden;
  border: 1px solid rgb(253 230 138);
  border-left: 6px solid rgb(245 158 11);
  border-radius: 16px;
  background: #fff;
  color: rgb(15 23 42);
  box-shadow: 0 18px 45px rgb(15 23 42 / 0.22), 0 2px 6px rgb(15 23 42 / 0.08);
  transform: translateX(-50%);
  animation: alpha-debt-notice-in 0.45s cubic-bezier(.2, .9, .3, 1.2) both;
}
.alpha-debt-notice.is-due { border-color: rgb(254 202 202); border-left-color: rgb(220 38 38); }
.dark .alpha-debt-notice { background: rgb(15 23 42); color: #fff; border-color: rgb(120 53 15); border-left-color: rgb(245 158 11); }
.dark .alpha-debt-notice.is-due { border-color: rgb(127 29 29); border-left-color: rgb(239 68 68); }
.alpha-debt-notice-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgb(245 158 11);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 900;
}
.alpha-debt-notice.is-due .alpha-debt-notice-icon { background: rgb(220 38 38); }
.alpha-debt-notice-body { min-width: 0; display: grid; gap: 2px; }
.alpha-debt-notice-body p { margin: 0; }
.alpha-debt-notice-kicker { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(180 83 9); }
.alpha-debt-notice.is-due .alpha-debt-notice-kicker { color: rgb(220 38 38); }
.dark .alpha-debt-notice-kicker { color: rgb(252 211 77); }
.dark .alpha-debt-notice.is-due .alpha-debt-notice-kicker { color: rgb(252 165 165); }
/* Wraps instead of cutting: the amount must always show, even after a long name. */
.alpha-debt-notice-main { font-size: 1.05rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.alpha-debt-notice-main .amt { white-space: nowrap; }
.alpha-debt-notice-main strong { font-weight: 900; }
.alpha-debt-notice-main .amt { font-size: 1.35rem; font-weight: 900; color: rgb(220 38 38); font-variant-numeric: tabular-nums; }
.dark .alpha-debt-notice-main .amt { color: rgb(248 113 113); }
.alpha-debt-notice-sub { font-size: 0.75rem; color: rgb(100 116 139); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dark .alpha-debt-notice-sub { color: rgb(148 163 184); }
.alpha-debt-notice-due { font-size: 0.8rem; font-weight: 600; color: rgb(51 65 85); }
.alpha-debt-notice-due strong { font-weight: 900; }
.alpha-debt-notice.is-due .alpha-debt-notice-due { color: rgb(220 38 38); }
.dark .alpha-debt-notice-due { color: rgb(226 232 240); }
.alpha-debt-notice-ok {
  align-self: start;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 0.6rem;
  background: rgb(15 23 42);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}
.alpha-debt-notice-ok:hover { background: rgb(51 65 85); }
.dark .alpha-debt-notice-ok { background: #fff; color: rgb(15 23 42); }
.alpha-debt-notice-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgb(245 158 11);
  transform-origin: left;
  animation: alpha-debt-notice-timer 9s linear both;
}
.alpha-debt-notice.is-due .alpha-debt-notice-timer { background: rgb(220 38 38); }
@keyframes alpha-debt-notice-in {
  from { opacity: 0; transform: translate(-50%, -24px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes alpha-debt-notice-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .alpha-debt-notice { animation: none; }
}
