.payment-entry,
.invoice-choice,
.invoice-choice-row,
.invoice-fields,
.invoice-fields-heading > div,
.invoice-fields-grid,
.invoice-fields-grid > *,
.invoice-field { min-width: 0; }

.invoice-choice {
  width: 100%;
  max-width: 100%;
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid #cddfe2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 56, 79, .05);
}

.invoice-choice.is-open {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(130, 192, 199, .14);
}

.invoice-choice-row {
  min-height: 78px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 13px;
}

.invoice-choice-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--navy);
  background: var(--aqua-soft);
}

.invoice-choice-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invoice-choice-copy strong,
.invoice-choice-copy small { display: block; }
.invoice-choice-copy strong { color: var(--navy); font-size: 16px; }
.invoice-choice-copy small { margin-top: 4px; color: var(--muted); font-size: 12px; }

.invoice-toggle {
  margin: 0 !important;
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: var(--navy) !important;
  cursor: pointer;
}

.invoice-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.invoice-toggle > span { position: relative; width: 45px; height: 26px; border-radius: 999px; background: #cedbdd; transition: .2s; }
.invoice-toggle > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px #00384f33; transition: .2s; }
.invoice-toggle input:checked + span { background: var(--navy); }
.invoice-toggle input:checked + span::after { transform: translateX(19px); }
.invoice-toggle input:focus-visible + span { outline: 3px solid rgba(130, 192, 199, .45); }
.invoice-toggle b { font-size: 12px; }

.invoice-settings {
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy);
  background: #f8fbfb;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.invoice-settings:hover { border-color: var(--aqua); background: var(--aqua-soft); }
.invoice-settings svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.invoice-fields { width: 100%; max-width: 100%; padding: 18px; border-top: 1px solid var(--line); background: #f7fbfb; }
.invoice-fields-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.invoice-fields-heading strong,
.invoice-fields-heading small { display: block; }
.invoice-fields-heading strong { color: var(--navy); }
.invoice-fields-heading small { margin-top: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.invoice-fields-heading > span { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: #356d76; background: #dceff1; font-size: 9px; font-weight: 900; letter-spacing: .08em; }

.invoice-fields-grid { width: 100%; max-width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.invoice-field { margin: 0 !important; display: grid !important; gap: 6px; color: var(--navy) !important; font-size: 10px !important; font-weight: 900 !important; }
.invoice-field input { width: 100%; max-width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none; }
.invoice-field input:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(130, 192, 199, .18); }
.invoice-field-name,
.invoice-field-address { grid-column: span 2; }

.invoice-customer-actions {
  margin-top: 16px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.invoice-customer-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.invoice-customer-actions p.success { color: var(--success); }
.invoice-customer-actions p.error { color: var(--danger); }

.invoice-customer-save {
  flex: 0 0 auto;
  border-color: var(--navy);
  color: #fff;
  background: var(--navy);
  cursor: pointer;
}

.invoice-customer-save:disabled {
  opacity: .55;
  cursor: wait;
}

.receipt-invoice-data {
  margin: 10px 0;
  padding: 8px 0;
  display: grid;
  gap: 2px;
  border-top: 1px dashed #444;
  border-bottom: 1px dashed #444;
  overflow-wrap: anywhere;
}

.receipt-invoice-data strong {
  margin-bottom: 3px;
  font-size: 9px;
  letter-spacing: .03em;
}

.receipt-invoice-data span { display: block; }

.c95-dialog { width: min(780px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 20px; }
.c95-dialog-card { width: auto !important; padding: 0 !important; }
.c95-dialog-heading { padding: 24px; display: grid; grid-template-columns: 58px 1fr auto; gap: 15px; align-items: start; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #f7fbfb, #edf6f7); }
.c95-dialog-heading h2 { margin: 2px 0 5px; color: var(--navy); font-size: 25px; }
.c95-dialog-heading p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.c95-dialog-heading > button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--navy); background: #fff; font-size: 20px; }
.c95-dialog-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: var(--navy); font-weight: 900; }
.c95-credentials { padding: 20px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.c95-credentials label { margin: 0; }
.c95-result { margin: 0 24px 15px; padding: 11px 13px; border-radius: 9px; font-size: 12px; font-weight: 800; }
.c95-result.success { color: #146844; background: #e5f6ee; }
.c95-result.error { color: #9b3030; background: #fff0f0; }
.c95-actions { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 9px; }
.c95-actions .button { width: auto; }
.c95-register { padding: 20px 24px 24px; border-top: 1px solid var(--line); background: #fafcfc; }
.c95-register h3 { margin: 0; color: var(--navy); }
.c95-history { margin-top: 12px; display: grid; gap: 7px; max-height: 260px; overflow: auto; }
.c95-history article { padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.c95-history strong,
.c95-history small { display: block; }
.c95-history small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.c95-state { padding: 5px 8px; border-radius: 999px; color: var(--navy); background: var(--aqua-soft); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.c95-empty { padding: 25px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 10px; }

@media (max-width: 1050px) {
  .invoice-choice-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .invoice-settings { grid-column: 2 / -1; justify-self: start; }
  .invoice-fields-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .invoice-choice-row { grid-template-columns: 40px minmax(0, 1fr); }
  .invoice-toggle { grid-column: 1 / 2; }
  .invoice-settings { grid-column: 2; }
  .invoice-toggle b,
  .invoice-settings span { display: none; }
  .invoice-fields-grid,
  .c95-credentials { grid-template-columns: minmax(0, 1fr); }
  .invoice-field-name,
  .invoice-field-address { grid-column: auto; }
  .invoice-customer-actions { align-items: stretch; flex-direction: column; }
  .invoice-customer-save { width: 100%; }
  .c95-dialog-heading { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .c95-dialog-icon { width: 48px; height: 48px; }
}
