/* Formal invoice document + shared toast / offers */

.ci-page {
  padding: 1rem 0 2.75rem;
  max-width: 640px;
}

.ci-doc {
  background: #fff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  color: #0f172a;
}

.ci-doc__head {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem 1.35rem;
  border-bottom: 2px solid #0f172a;
  background: #f8fafc;
}

.ci-doc__brand strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.ci-doc__brand span {
  display: block;
  margin-top: .2rem;
  font-size: .78rem;
  color: #64748b;
  font-weight: 600;
}

.ci-doc__meta {
  text-align: left;
  min-width: 9.5rem;
}

.ci-doc__doc-title {
  font-size: .95rem;
  font-weight: 800;
  margin-bottom: .55rem;
  color: #0f172a;
}

.ci-doc__meta dl {
  margin: 0;
  display: grid;
  gap: .28rem;
}

.ci-doc__meta dl > div {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  font-size: .75rem;
}

.ci-doc__meta dt {
  color: #64748b;
  font-weight: 600;
  margin: 0;
}

.ci-doc__meta dd {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}

.ci-doc__party,
.ci-doc__items {
  padding: 1.15rem 1.35rem 0;
}

.ci-doc__party h2,
.ci-doc__items h2 {
  margin: 0 0 .65rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: .4rem;
}

.ci-doc__subject {
  margin: 0 0 .85rem;
  font-size: .95rem;
  font-weight: 700;
  color: #0f172a;
}

.ci-doc__kv {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}

.ci-doc__kv th,
.ci-doc__kv td {
  padding: .45rem 0;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.ci-doc__kv th {
  width: 34%;
  font-weight: 600;
  color: #64748b;
  text-align: right;
}

.ci-doc__kv td {
  font-weight: 650;
  color: #0f172a;
  text-align: left;
}

.ci-doc__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  margin-bottom: .25rem;
}

.ci-doc__table th,
.ci-doc__table td {
  padding: .65rem .55rem;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
}

.ci-doc__table thead th {
  background: #f1f5f9;
  font-weight: 750;
  color: #334155;
  text-align: right;
}

.ci-doc__table tbody td:last-child,
.ci-doc__table thead th:last-child,
.ci-doc__table tfoot td {
  text-align: left;
  white-space: nowrap;
}

.ci-doc__table tfoot th {
  text-align: right;
  background: #f8fafc;
  font-weight: 700;
}

.ci-doc__table tfoot td {
  background: #f8fafc;
  font-weight: 800;
  font-size: .95rem;
  color: #0f172a;
}

.ci-doc__wallet-row th,
.ci-doc__wallet-row td {
  font-weight: 600 !important;
  font-size: .8rem !important;
  color: #64748b !important;
  background: #fff !important;
}

.ci-doc__legal {
  margin: 1rem 1.35rem 0;
  padding: .85rem 0 0;
  border-top: 1px dashed #cbd5e1;
  font-size: .76rem;
  line-height: 1.75;
  color: #64748b;
}

.ci-doc__actions {
  padding: 1.15rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.ci-doc__pay {
  width: 100%;
  border: 0;
  background: #0f172a;
  color: #fff;
  font-weight: 750;
  font-size: .92rem;
  padding: .85rem 1rem;
  border-radius: 4px;
}

.ci-doc__pay:hover { background: #1e293b; color: #fff; }
.ci-doc__pay:disabled { opacity: .5; }

.ci-doc__secondary {
  width: 100%;
  border: 1px solid #94a3b8;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  font-size: .86rem;
  padding: .7rem 1rem;
  border-radius: 4px;
}

.ci-doc__secondary:disabled {
  opacity: .55;
  color: #94a3b8;
  border-color: #e2e8f0;
}

.ci-doc__edit {
  text-align: center;
  font-size: .82rem;
  font-weight: 650;
  color: #475569;
  text-decoration: none;
  padding: .25rem;
}

.ci-doc__edit:hover { color: #0f172a; text-decoration: underline; }

.ci-doc__warn {
  margin: .35rem 0 0;
  font-size: .8rem;
  color: #9a3412;
  text-align: center;
}

@media (max-width: 575.98px) {
  .ci-doc__head {
    flex-direction: column;
    gap: .85rem;
    padding: 1rem 1rem .95rem;
  }

  .ci-doc__meta {
    width: 100%;
    text-align: right;
    min-width: 0;
    padding-top: .65rem;
    border-top: 1px solid #e2e8f0;
  }

  .ci-doc__party,
  .ci-doc__items,
  .ci-doc__actions {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .ci-doc__legal { margin-right: 1rem; margin-left: 1rem; }

  .ci-doc__kv th { width: 40%; }
  .ci-doc__table { font-size: .76rem; }
  .ci-doc__table th,
  .ci-doc__table td { padding: .5rem .4rem; }
}

/* Toast alerts */
.vg-toast-stack {
  position: fixed;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1060;
  width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.vg-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem .95rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(37, 99, 235, .16);
  box-shadow: 0 16px 40px rgba(15, 23, 42, .14), 0 4px 12px rgba(37, 99, 235, .08);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-14px) scale(.96);
  transition: opacity .28s ease, transform .32s cubic-bezier(.22, 1, .36, 1);
  pointer-events: auto;
  margin-bottom: .55rem;
}

.vg-toast.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.vg-toast.is-leaving { opacity: 0; transform: translateY(-10px) scale(.98); }
.vg-toast--success { border-color: rgba(22, 163, 74, .22); }
.vg-toast--error,
.vg-toast--warning { border-color: rgba(245, 158, 11, .28); }
.vg-toast--error { border-color: rgba(239, 68, 68, .28); }

.vg-toast__icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: #2563eb;
  font-size: 1rem;
}

.vg-toast--success .vg-toast__icon { background: #ecfdf5; color: #16a34a; }
.vg-toast--warning .vg-toast__icon { background: #fffbeb; color: #d97706; }
.vg-toast--error .vg-toast__icon { background: #fef2f2; color: #dc2626; }

.vg-toast__body { flex: 1; min-width: 0; }
.vg-toast__title { display: block; font-size: .9rem; font-weight: 800; color: #0f172a; }
.vg-toast__subtitle { display: block; margin-top: .2rem; font-size: .8rem; color: #64748b; line-height: 1.55; }

.vg-toast__close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  padding: .1rem;
  line-height: 1;
}

.vg-toast__progress {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transform-origin: right;
  animation: vgToastProgress 4.2s linear forwards;
}

.vg-toast--success .vg-toast__progress { background: linear-gradient(90deg, #16a34a, #4ade80); }
.vg-toast--warning .vg-toast__progress { background: linear-gradient(90deg, #d97706, #fbbf24); }
.vg-toast--error .vg-toast__progress { background: linear-gradient(90deg, #dc2626, #f87171); }

@keyframes vgToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.lm-offers-wrap { max-width: 720px; }
.lm-offers-empty {
  text-align: center;
  padding: 1.75rem 1.25rem;
  border-radius: 16px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}
.lm-offers-empty i { font-size: 1.6rem; color: #94a3b8; display: block; margin-bottom: .5rem; }
.lm-offer-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: #fff;
  margin-bottom: .75rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

/* Capital ad FAQ builder */
.capital-faq-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: .85rem .9rem;
}

.capital-faq-item.is-confirmed {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.capital-faq-item .faq-summary { display: none; }
.capital-faq-item.is-confirmed .faq-edit { display: none; }
.capital-faq-item.is-confirmed .faq-summary { display: block; }

.faq-summary__top {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  margin-bottom: .35rem;
}

.faq-summary__top > i {
  color: #16a34a;
  margin-top: .15rem;
  flex-shrink: 0;
}

.faq-summary__q {
  font-size: .88rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.5;
}

.faq-summary__a {
  margin: 0;
  font-size: .8rem;
  color: #64748b;
  line-height: 1.65;
}

/* OTP modal on create */
.ca-otp-modal .modal-content {
  border: 0; border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 48px rgba(15,23,42,.18);
}
