/* Invoicing page — extends dashboard shell */

:root {
  --inv-purple: var(--dash-accent);
  --inv-purple-soft: var(--dash-surface-hover);
  --inv-card-elevated: var(--dash-elevated);
  --inv-border: rgba(255, 255, 255, 0.08);
  --inv-text: #f4f4f5;
  --inv-orange: #f59e0b;
  --inv-orange-soft: rgba(245, 158, 11, 0.14);
  --inv-right-w: 360px;
  --inv-surface-solid: var(--nv-surface-solid, #161618);
}

body.inv-page {
  --dash-purple: var(--inv-purple);
  --dash-purple-soft: var(--inv-purple-soft);
}


.inv-page .dash-new-btn,
.inv-page .dash-pro__btn {
  background: var(--inv-purple);
}

.inv-page .dash-search input:focus {
  border-color: var(--dash-border-strong);
  box-shadow: 0 0 0 3px var(--dash-surface-hover);
}

.inv-content {
  padding: var(--dash-content-y, 32px) var(--dash-page-x, 32px);
  padding-left: calc(var(--dash-page-x, 32px) + var(--dash-mobile-nav-gutter, 0px));
  padding-bottom: calc(var(--dash-content-y, 32px) + var(--dash-content-pad-bottom, 0px));
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  container-type: inline-size;
  container-name: inv-content;
}

.inv-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.inv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.inv-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  container: inv-main / inline-size;
}

[data-inv-doc-panel][hidden] {
  display: none;
}

.inv-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 24px;
}

.inv-title {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--inv-text);
}

/* Section tabs → dash-landing-components (pill segment) */

/* KPI — separate islands with 4px gap */
.inv-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.inv-summary__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  min-height: 86px;
  min-width: 0;
  background: var(--inv-surface-solid);
  border: none;
  border-radius: var(--dash-radius-card);
}

.inv-summary__icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.inv-summary__icon--purple { background: var(--inv-purple-soft); color: var(--inv-purple); }
.inv-summary__icon--green { background: var(--dash-green-soft); color: var(--dash-green); }
.inv-summary__icon--orange { background: var(--inv-orange-soft); color: var(--inv-orange); }
.inv-summary__icon--red { background: var(--dash-red-soft); color: var(--dash-red); }

.inv-summary__label {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--dash-text-muted);
}

.inv-summary__value {
  margin: 0 0 6px;
  font-weight: 600;
}

.inv-summary__meta {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
}

.inv-summary__meta--up { color: var(--dash-green); }
.inv-summary__meta--muted { color: var(--dash-text-subtle); }
.inv-summary__meta--danger { color: var(--dash-red); }

/* Filters toolbar */
.inv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  position: relative;
}

.inv-toolbar__left {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  position: relative;
  z-index: 1;
}

.inv-toolbar__left::-webkit-scrollbar {
  display: none;
}

.inv-doc-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 3px;
  border-radius: 14px;
  background: var(--dash-card);
  flex: 0 0 auto;
}

.inv-doc-switch__btn {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--dash-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}

.inv-doc-switch__btn:hover,
.inv-doc-switch__btn:focus-visible {
  color: var(--inv-text);
  outline: none;
}

.inv-doc-switch__btn.is-active {
  background: var(--dash-elevated);
  color: var(--inv-text);
}

.inv-search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 14px;
  border: none;
  background: var(--dash-card);
  min-width: 180px;
  max-width: 240px;
  flex: 0 0 220px;
}

.inv-search-pill svg {
  flex-shrink: 0;
  color: var(--dash-text-subtle);
}

.inv-search-pill input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--inv-text);
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.inv-search-pill input::placeholder {
  color: var(--dash-text-subtle);
}

.inv-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 14px;
  border: none;
  background: var(--dash-card);
  color: var(--dash-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.inv-chip:hover,
.inv-chip:focus-visible {
  background: var(--inv-card-elevated);
  color: var(--inv-text);
  border-color: rgba(255, 255, 255, 0.12);
  outline: none;
}

.inv-chip--clear {
  flex-shrink: 0;
  color: var(--dash-text-subtle);
}

.inv-export-btn {
  flex: 0 0 auto;
}

.inv-filter-select {
  min-width: 132px;
  height: 36px;
  border: 0;
  border-radius: 14px;
  background: var(--dash-card);
  color: var(--dash-text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.inv-toolbar .nv-select-wrap {
  flex: 0 0 auto;
}

.inv-toolbar .nv-select__trigger {
  height: 36px;
  border-radius: 14px;
  background: var(--dash-card);
  color: var(--dash-text-muted);
  font-size: 13px;
  font-weight: 500;
}

.inv-chip__chev {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.inv-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  border: none;
  background: var(--dash-card);
  color: var(--dash-text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  z-index: 3;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.inv-icon-btn:hover {
  background: var(--inv-card-elevated);
  color: var(--inv-text);
  transform: translateY(-1px);
}

.inv-bulk-actions {
  min-height: 48px;
  padding: 6px 8px 6px 16px;
  border-radius: 16px;
  background: var(--dash-elevated);
  color: var(--inv-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.inv-bulk-actions[hidden] { display: none; }

.inv-bulk-actions strong {
  font-size: 13px;
  font-weight: 600;
}

.inv-bulk-actions__buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.inv-bulk-actions button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--dash-text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.inv-bulk-actions button:hover,
.inv-bulk-actions button:focus-visible {
  background: var(--dash-surface-hover);
  color: var(--inv-text);
  outline: none;
}

.inv-bulk-actions .inv-bulk-actions__danger { color: var(--dash-red); }

/* Table card */
.inv-table-card {
  background: var(--inv-surface-solid);
  border: none;
  border-radius: 20px;
  box-shadow: var(--dash-shadow);
  overflow: hidden;
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.inv-table-card:hover {
  box-shadow: var(--dash-shadow-hover);
}

.inv-table-wrap { overflow-x: auto; }

.inv-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.inv-table thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--dash-text-subtle);
  border-bottom: 1px solid var(--inv-border);
  white-space: nowrap;
}

.inv-table thead th:first-child,
.inv-table tbody td:first-child {
  width: 44px;
  padding-left: 20px;
}

.inv-table tbody tr {
  transition: background 150ms ease;
}

.inv-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.inv-row-link {
  cursor: pointer;
}

.inv-table tbody td {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.inv-table tbody tr:last-child td { border-bottom: none; }

.inv-check {
  cursor: pointer;
}

.inv-invoice-num {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.inv-invoice-date {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--dash-text-subtle);
}

.inv-client {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.inv-client__avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
}

.inv-client__avatar--acme { background: var(--inv-purple-soft); color: var(--inv-purple); }
.inv-client__avatar--web { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.inv-client__avatar--design { background: rgba(236, 72, 153, 0.14); color: #ec4899; }
.inv-client__avatar--usdt { background: rgba(38, 161, 123, 0.14); color: #26a17b; }
.inv-client__avatar--crypto { background: var(--dash-border); color: var(--inv-purple); }
.inv-client__avatar--marketing { background: var(--inv-orange-soft); color: var(--inv-orange); }
.inv-client__avatar--nexora { background: rgba(161, 161, 170, 0.12); color: #e4e4e7; }
.inv-client__avatar--northwind { background: rgba(14, 124, 102, 0.16); color: #34d399; }
.inv-client__avatar--atlas { background: rgba(148, 163, 184, 0.16); color: #e2e8f0; }

.inv-client__name {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.inv-client__domain {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--dash-text-subtle);
}

.inv-amount {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.inv-amount__sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--dash-text-subtle);
}

.inv-due {
  white-space: nowrap;
}

.inv-due__date {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.inv-due__sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--dash-red);
}

.inv-due__sub--muted {
  color: var(--dash-text-subtle);
}

.inv-status {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.inv-status--overdue {
  background: var(--dash-red-soft);
  color: var(--dash-red);
}

.inv-status--paid {
  background: var(--dash-green-soft);
  color: var(--dash-green);
}

.inv-status--sent {
  background: var(--inv-purple-soft);
  color: var(--inv-purple);
}

.inv-status--draft {
  background: rgba(255, 255, 255, 0.06);
  color: var(--dash-text-muted);
}

.inv-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.inv-preview-btn {
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--dash-text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.inv-preview-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--inv-text);
  border-color: rgba(255, 255, 255, 0.14);
}

.inv-row-action {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--dash-text-subtle);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 150ms ease, color 150ms ease;
}

.inv-row-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--inv-text);
}

.inv-action-menu {
  position: fixed;
  z-index: var(--dash-popover-z, 1600);
  min-width: 188px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--inv-border);
  background: var(--dash-popover-bg, #202020);
  box-shadow: var(--dash-popover-shadow, 0 18px 44px rgba(0, 0, 0, 0.34));
}

.inv-action-menu[hidden] {
  display: none;
}

.inv-action-menu__item {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--inv-text);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.inv-action-menu__item:hover,
.inv-action-menu__item:focus-visible {
  background: var(--dash-surface-hover);
  outline: none;
}

.inv-action-menu__item--danger {
  color: var(--dash-red);
}

/* Pagination */
.inv-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--inv-border);
}

.inv-pagination__info {
  margin: 0;
  font-size: 13px;
  color: var(--dash-text-subtle);
}

.inv-pagination__pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.inv-page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--dash-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 150ms ease, color 150ms ease;
}

.inv-page-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--inv-text);
}

.inv-page-btn.is-active {
  background: #f4f4f5;
  color: #09090b;
}

.inv-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.inv-pagination__rows {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--dash-text-subtle);
}

.inv-pagination__select {
  min-height: 36px;
  padding: 0 34px 0 14px;
  border-radius: 999px;
  border: none;
  background: var(--inv-card-elevated);
  color: var(--inv-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.inv-pagination__rows .nv-select-wrap {
  --nv-select-height: 36px;
  width: 68px;
}

.inv-pagination__rows .nv-select__trigger {
  width: 100%;
  justify-content: flex-start;
  border-radius: 999px;
  background: var(--inv-card-elevated);
  color: var(--inv-text);
  font-size: 13px;
  font-weight: 500;
  padding-inline: 14px 32px;
}

.inv-pagination__rows .nv-select__trigger:hover,
.inv-pagination__rows .nv-select-wrap.is-open .nv-select__trigger {
  background: rgba(255, 255, 255, 0.08);
}

/* Right panel */
.inv-panel {
  background: var(--inv-surface-solid);
  border: none;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--dash-shadow);
  transition: box-shadow 150ms ease;
}

.inv-panel:hover {
  box-shadow: var(--dash-shadow-hover);
}

.inv-composer {
  display: grid;
  gap: 16px;
  overflow: hidden;
  padding: 20px;
  background: var(--inv-surface-solid);
  border: none;
  border-radius: 20px;
  box-shadow: none;
}

.inv-composer:hover {
  box-shadow: none;
}

.inv-composer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.inv-composer__eyebrow {
  margin: 0 0 4px;
  color: var(--dash-text-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.inv-composer__title {
  margin: 0;
  color: var(--inv-text);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.2;
}

.inv-aside .inv-composer {
  gap: 14px;
  padding: 20px;
}

.inv-aside .inv-composer__head {
  align-items: flex-start;
}

.inv-aside .inv-composer__subtitle {
  display: none;
}

.inv-aside .inv-composer__total strong {
  font-size: 20px;
}

.inv-aside .inv-compose-form__fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inv-aside .inv-compose-form__field--client,
.inv-aside .inv-compose-form__field--item {
  grid-column: 1 / -1;
}

.inv-aside .inv-compose-form__field input,
.inv-aside .inv-compose-form__field select:not(.nv-select__native),
.inv-aside .inv-compose-form__field .nv-select__trigger {
  min-height: 44px;
  border-radius: 13px;
  font-size: 12px;
}

.inv-aside .inv-compose-form__field .nv-select-wrap {
  --nv-select-height: 44px;
}

.inv-aside .inv-compose-form__footer {
  align-items: stretch;
  flex-direction: column;
}

.inv-aside .inv-compose-form__field--number {
  flex-basis: auto;
}

.inv-aside .inv-compose-form__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin-inline-start: 0;
}

.inv-aside .inv-compose-form__button {
  min-height: 44px;
  padding-inline: 12px;
}

.inv-composer__subtitle {
  margin: 4px 0 0;
  max-width: none;
  color: var(--dash-text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.inv-composer__total {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 2px;
}

.inv-composer__total span {
  color: var(--dash-text-subtle);
  font-size: 11px;
  font-weight: 600;
}

.inv-composer__total strong {
  color: var(--dash-text);
  font-size: 24px;
  font-weight: 750;
  line-height: 1.1;
}

.inv-composer__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inv-composer__summary div {
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--nv-radius-card, 14px);
  background: var(--nv-surface-elevated, #1c1c1e);
}

.inv-composer__summary div:first-child {
  grid-column: 1 / -1;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--nv-surface-elevated, #1c1c1e) 86%, var(--dash-text) 5%);
}

.inv-composer__summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--dash-text-subtle);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
}

.inv-composer__summary strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--dash-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-composer__summary div:first-child strong {
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.inv-composer__split {
  display: grid;
  gap: 16px;
}

.inv-compose-form {
  display: grid;
  gap: 12px;
}

.inv-compose-form__fields {
  display: grid;
  grid-template-columns: minmax(140px, 1.25fr) minmax(170px, 1.5fr) minmax(64px, 0.48fr) minmax(96px, 0.75fr) minmax(104px, 0.8fr);
  gap: 10px;
}

.inv-compose-form__fieldset {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inv-compose-form__fieldset legend {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0 0 2px;
  color: var(--dash-text-subtle);
  font-size: 12px;
  font-weight: 650;
}

.inv-compose-form__fieldset legend span {
  display: none;
}

.inv-compose-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inv-compose-form__field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.inv-compose-form__field label {
  color: var(--dash-text-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.inv-compose-form__field input,
.inv-compose-form__field select:not(.nv-select__native) {
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--nv-surface-elevated, #1c1c1e);
  color: var(--dash-text);
  font: inherit;
  font-size: 14px;
  padding: 0 14px;
  box-sizing: border-box;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.inv-compose-form__footer {
  display: flex;
  align-items: end;
  gap: 12px;
  min-width: 0;
}

.inv-compose-form__field--number {
  flex: 0 1 190px;
}

.inv-compose-form__field select:not(.nv-select__native) {
  appearance: none;
  padding-inline-end: 32px;
  background-image:
    linear-gradient(45deg, transparent 50%, color-mix(in srgb, var(--dash-text) 70%, transparent) 50%),
    linear-gradient(135deg, color-mix(in srgb, var(--dash-text) 70%, transparent) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.inv-compose-form__field input:hover,
.inv-compose-form__field select:not(.nv-select__native):hover {
  border-color: var(--nv-border-subtle, rgba(255, 255, 255, 0.08));
  background-color: color-mix(in srgb, var(--nv-surface-elevated, #1c1c1e) 88%, var(--dash-text) 4%);
}

.inv-compose-form__field input[type="number"] {
  appearance: textfield;
}

.inv-compose-form__field input[type="number"]::-webkit-outer-spin-button,
.inv-compose-form__field input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.inv-compose-form__field input:focus-visible,
.inv-compose-form__field select:not(.nv-select__native):focus-visible {
  border-color: color-mix(in srgb, var(--dash-text) 28%, transparent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dash-text) 9%, transparent);
}

.inv-compose-form__field .nv-select-wrap {
  --nv-select-height: 48px;
  width: 100%;
  min-width: 0;
  flex-shrink: 1;
}

.inv-compose-form__field .nv-select__trigger {
  width: 100%;
  justify-content: flex-start;
  border-radius: 16px;
  background: var(--nv-surface-elevated, #1c1c1e);
  color: var(--dash-text);
  font-size: 14px;
  padding-inline: 14px 34px;
}

.inv-compose-form__field .nv-select__trigger:hover,
.inv-compose-form__field .nv-select-wrap.is-open .nv-select__trigger {
  background: color-mix(in srgb, var(--nv-surface-elevated, #1c1c1e) 88%, var(--dash-text) 4%);
  color: var(--dash-text);
}

.inv-compose-form__field .nv-select__trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dash-text) 9%, transparent);
}

.inv-compose-form__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--nv-surface-elevated, #1c1c1e);
}

.inv-compose-form__total span {
  color: var(--dash-text-subtle);
  font-size: 12px;
  font-weight: 650;
}

.inv-compose-form__total strong {
  color: var(--dash-text);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.inv-compose-form__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  margin-inline-start: auto;
}

.inv-compose-form__button {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--nv-surface-elevated, #1c1c1e);
  color: var(--dash-text);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.inv-compose-form__button--primary {
  border-color: transparent;
  background: var(--dash-text);
  color: var(--dash-bg);
}

.inv-compose-form__button:hover {
  border-color: color-mix(in srgb, var(--dash-text) 18%, transparent);
  background: color-mix(in srgb, var(--dash-elevated) 72%, var(--dash-text) 7%);
}

.inv-compose-form__button--primary:hover {
  background: color-mix(in srgb, var(--dash-text) 88%, transparent);
  color: var(--dash-bg);
}

.inv-compose-form__button:focus-visible {
  outline: 2px solid var(--dash-blue);
  outline-offset: 2px;
}

.inv-compose-form__status {
  margin: 0;
  color: var(--dash-text-subtle);
  font-size: 12px;
}

.inv-compose-form__status:empty {
  display: none;
}

.inv-compose-preview {
  display: grid;
  gap: 8px;
}

.inv-compose-preview__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--dash-text-subtle);
  font-size: 11px;
  font-weight: 650;
}

.inv-compose-preview__caption strong {
  min-width: 0;
  overflow: hidden;
  color: var(--dash-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-compose-preview__paper {
  position: relative;
  display: grid;
  gap: 12px;
  max-height: 220px;
  overflow: hidden;
  padding: 16px;
  border-radius: 20px;
  background: var(--nv-surface-elevated, #1c1c1e);
  color: var(--dash-text);
  box-shadow: none;
}

.inv-compose-preview__paper::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--nv-surface-elevated, #1c1c1e));
}

.inv-compose-preview__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inv-compose-preview__logo {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--dash-text);
  color: var(--dash-bg);
  font-weight: 700;
}

.inv-compose-preview__label,
.inv-compose-preview__bill span,
.inv-compose-preview__meta,
.inv-compose-preview__totals dt {
  margin: 0;
  color: var(--dash-text-subtle);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.inv-compose-preview__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0 0;
  border-top: 1px solid var(--nv-border-subtle, rgba(255, 255, 255, 0.08));
}

.inv-compose-preview__top strong,
.inv-compose-preview__bill strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.inv-compose-preview__bill,
.inv-compose-preview__line {
  display: grid;
  gap: 4px;
}

.inv-compose-preview__line {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 9px 0;
  border-block: 1px solid var(--nv-border-subtle, rgba(255, 255, 255, 0.08));
  font-size: 13px;
}

.inv-compose-preview__line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-compose-preview__totals {
  display: grid;
  gap: 8px;
  margin: 0;
}

.inv-compose-preview__totals div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inv-compose-preview__totals dd {
  margin: 0;
  color: var(--dash-text);
  font-size: 17px;
  font-weight: 700;
}

.inv-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.inv-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.inv-panel > .inv-panel__title {
  margin-bottom: 16px;
}

.inv-paylink__field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.035);
  margin-top: 10px;
}

.inv-paylink__field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--dash-text-muted);
  font-size: 13px;
  outline: none;
}

.inv-paylink__copy {
  padding: 4px 10px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--dash-text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.inv-paylink__copy:hover {
  background: var(--inv-purple-soft);
  color: var(--inv-purple);
}

.inv-paylink__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inv-paylink__new {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 72px;
  padding: 14px 10px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--dash-text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.inv-paylink__new--wide {
  grid-column: 1 / -1;
}

.inv-paylink__new svg {
  color: var(--inv-purple);
}

.inv-paylink__new:hover {
  background: var(--dash-surface-hover);
  color: var(--dash-text);
  transform: translateY(-2px);
}

.inv-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--dash-toast-z, 1700);
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--inv-border);
  background: var(--dash-popover-bg, #202020);
  color: var(--inv-text);
  box-shadow: var(--dash-popover-shadow, 0 18px 44px rgba(0, 0, 0, 0.34));
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--dash-transition), transform var(--dash-transition);
}

.inv-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 800px) {
  .inv-content {
    padding-bottom: calc(var(--spacing-4xl) + 192px);
  }
}

@container inv-content (max-width: 1040px) {
  .inv-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .inv-aside {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

}

@container inv-main (max-width: 760px) {
  .inv-compose-form__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inv-compose-form__field--client,
  .inv-compose-form__field--item {
    grid-column: span 1;
  }

  .inv-compose-form__field--qty,
  .inv-compose-form__field--rate,
  .inv-compose-form__field--terms {
    grid-column: span 1;
  }

  .inv-compose-form__field--terms {
    grid-column: 1 / -1;
  }

  .inv-compose-form__footer {
    align-items: end;
    flex-wrap: wrap;
  }

  .inv-compose-form__actions {
    flex: 1 1 100%;
    margin-inline-start: 0;
  }

  .inv-compose-form__button {
    flex: 1 1 0;
  }
}

@container inv-content (max-width: 860px) {
  .inv-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container inv-content (max-width: 680px) {
  .inv-content {
    padding-inline: 16px;
  }

  .inv-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .inv-toolbar__left {
    width: 100%;
  }

  .inv-icon-btn {
    align-self: flex-end;
  }

  .inv-aside,
  .inv-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .inv-compose-form__row,
  .inv-compose-form__actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .inv-composer__head {
    align-items: flex-start;
  }

  .inv-compose-form__fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .inv-compose-form__field--client,
  .inv-compose-form__field--item,
  .inv-compose-form__field--qty,
  .inv-compose-form__field--rate,
  .inv-compose-form__field--terms {
    grid-column: auto;
  }

  .inv-compose-form__field--number {
    flex-basis: 100%;
  }

  .inv-compose-form__actions {
    display: grid;
    width: 100%;
  }

  .inv-pagination {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

  .inv-pagination__pages,
  .inv-pagination__rows {
    justify-self: start;
  }
}
