/* New-invoice modal styles */
.new-inv-modal { width: 560px; max-width: 92vw; }

.ni-field {
  position: relative; display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); box-shadow: var(--shadow-xs);
  transition: border-color 100ms;
}
.ni-field:focus-within { border-color: var(--ink); }
.ni-input, .ni-select {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 14px; padding: 10px 12px;
  color: var(--ink); appearance: none;
}
.ni-prefix {
  padding-left: 12px; color: var(--muted); font-size: 15px; font-weight: 500;
}
.ni-caret {
  position: absolute; right: 10px; width: 14px; height: 14px;
  color: var(--muted); pointer-events: none;
}
.ni-select { padding-right: 30px; cursor: pointer; }

.ni-grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }

.ni-radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ni-radio {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; background: var(--surface);
  transition: all 100ms;
}
.ni-radio input { margin-top: 3px; accent-color: var(--ink); }
.ni-radio:hover { background: var(--line-soft); }
.ni-radio.on { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 3px rgba(15,23,42,0.06); }
.ni-radio b { font-size: 13px; font-weight: 600; color: var(--ink); display: block; }
.ni-radio span { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; line-height: 1.4; }

.ni-radio.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--line-soft);
  position: relative;
}
.ni-radio.disabled:hover { background: var(--line-soft); }
.ni-radio.disabled input { cursor: not-allowed; }
.ni-radio-lock {
  position: absolute; top: 10px; right: 10px;
  color: var(--dim);
}
.ni-radio-lock i { width: 13px; height: 13px; }

.ni-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.ni-doc {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; background: var(--surface); font-size: 13px;
  transition: all 100ms;
}
.ni-doc:hover { background: var(--line-soft); }
.ni-doc.on { border-color: var(--ink); }
.ni-doc i { width: 15px; height: 15px; color: var(--muted); }
.ni-doc.on i { color: var(--ink); }
.ni-doc input { margin-right: 2px; }

.ni-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font: inherit; font-size: 13px;
  color: var(--ink); background: var(--surface); resize: vertical;
  outline: 0;
}
.ni-textarea:focus { border-color: var(--ink); }

/* Review step */
.ni-review-card {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; background: #fafbfc;
}
.ni-review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ni-review-id { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.ni-review-buyer { font-size: 16px; font-weight: 600; color: var(--ink); margin-top: 4px; letter-spacing: -0.01em; }
.ni-review-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ni-review-amt {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 26px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1;
}
.ni-review-amt .cur { font-size: 15px; color: var(--muted); font-weight: 500; margin-right: 2px; }

.ni-review-docs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ni-review-doc {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; font-size: 11.5px; color: var(--text); font-weight: 500;
}
.ni-review-doc i { width: 12px; height: 12px; }

.ni-review-note {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--muted); font-style: italic;
}

/* Finance toggle card */
.ni-finance-toggle {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; background: var(--surface);
  transition: all 150ms;
}
.ni-finance-toggle.on {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.08);
}
.ni-ft-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.ni-ft-logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; flex-shrink: 0;
  color: #10b981;
}
.ni-finance-toggle.on .ni-ft-logo { border-color: #a7f3d0; background: #fff; }
.ni-ft-logo i { width: 18px; height: 18px; stroke-width: 2; }
.ni-ft-title { font-size: 13.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; display: inline-flex; align-items: center; gap: 8px; }
.ni-ft-chip {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff;
}
.ni-finance-toggle.on .ni-ft-chip { color: #065f46; border-color: #a7f3d0; background: #fff; }

.ni-switch {
  flex-shrink: 0;
  width: 36px; height: 20px; border-radius: 999px;
  background: #cbd5e1; position: relative;
  transition: background 120ms ease;
}
.ni-switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 999px; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 160ms ease;
}
.ni-switch.on { background: #059669; }
.ni-switch.on .ni-switch-thumb { transform: translateX(16px); }
.ni-ft-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.ni-ft-right { text-align: right; flex-shrink: 0; }
.ni-ft-payout {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 18px; font-weight: 600; color: #065f46;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.ni-finance-toggle:not(.on) .ni-ft-payout { color: var(--muted); }
.ni-ft-payout-sub { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.ni-ft-cb {
  position: absolute; top: 12px; right: 12px;
  appearance: none; width: 20px; height: 20px;
  border: 1.5px solid #cbd5e1; border-radius: 6px;
  background: #fff; cursor: pointer;
  transition: all 100ms;
}
.ni-ft-cb:checked { background: #059669; border-color: #059669; }
.ni-ft-cb:checked::after {
  content: ""; position: absolute; left: 5px; top: 2px;
  width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
/* Hide the raw checkbox in the top corner visually — keep whole card clickable */
.ni-finance-toggle .ni-ft-cb { display: none; }

/* Breakdown when financing is on */
.ni-breakdown {
  margin-top: 12px; padding: 14px 16px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px;
}
.ni-bd-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--text); }
.ni-bd-row b { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); }
.ni-bd-row.minus b { color: var(--muted); }
.ni-bd-sep { height: 1px; background: var(--line); margin: 8px -16px; }
.ni-bd-row.total { font-size: 14px; padding-top: 4px; }
.ni-bd-row.total span { font-weight: 600; color: var(--ink); }
.ni-bd-row.total b {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 20px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em;
}
.ni-bd-foot {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--muted); line-height: 1.5;
}
.ni-bd-foot i { width: 13px; height: 13px; color: var(--dim); flex-shrink: 0; margin-top: 2px; }
