:root {
  --invoice-dark-brown: #8a705d;
  --invoice-bg: #fffdfb;
  --invoice-surface: #fffefd;
  --invoice-border: #ead4c5;
  --invoice-text: var(--invoice-dark-brown);
  --invoice-accent-text: var(--invoice-dark-brown);
  --invoice-muted: #a39186;
  --invoice-fill: #f5eee8;
  --invoice-blue: #5c9ee8;
  --invoice-pink: #ff808c;
  --invoice-green: #30b86b;
}

.v2-content {
  background: #ffffff;
}

.v2-invoice-entry-page {
  width: 100%;
  max-width: 1510px;
  margin: 0 auto;
  padding: 14px 18px 36px;
  background: #ffffff !important;
  background-image: none !important;
  color: var(--invoice-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.v2-invoice-entry-page * {
  box-sizing: border-box;
}

.v2-invoice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.v2-invoice-form-column {
  min-width: 0;
}

.v2-invoice-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 220px;
  overflow: hidden;
}

.v2-invoice-title-block {
  position: relative;
  z-index: 1;
  width: 36%;
  padding: 8px 20px 12px;
  transform: translateY(-42px);
}

.v2-invoice-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v2-invoice-title-row h1 {
  margin: 0;
  color: var(--invoice-dark-brown);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
}

.v2-invoice-title-block p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0 0;
  color: var(--invoice-accent-text);
  font-size: 16px;
}

.v2-title-sakura {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.v2-invoice-hero-art {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 72%;
  height: 220px;
  object-fit: contain;
  object-position: right bottom;
}

.v2-invoice-section,
.v2-invoice-side-card,
.v2-invoice-action-card {
  border: 1px solid var(--invoice-border);
  border-radius: 16px;
  background: rgba(255, 254, 253, 0.95);
}

.v2-invoice-section {
  margin-bottom: 16px;
  padding: 20px 20px 18px;
}

.v2-invoice-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.v2-section-number {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--invoice-border);
  border-radius: 50%;
  background: #faf5ee;
  font-size: 15px;
  font-weight: 600;
}

.v2-invoice-section-heading h2,
.v2-invoice-side-card h2 {
  margin: 0;
  color: var(--invoice-accent-text);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0;
}

.v2-customer-section-grid {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) minmax(320px, 0.96fr);
  gap: clamp(40px, 8vw, 90px);
}

.v2-field-title,
.v2-invoice-field > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--invoice-accent-text);
  font-size: 13px;
  font-style: normal;
  font-weight: 650;
}

.v2-invoice-field em,
.v2-field-title em {
  margin-left: 8px;
  color: #aaa09b;
  font-style: normal;
  font-weight: 400;
}

.v2-invoice-control {
  width: 100%;
  height: 40px;
  border: 1px solid var(--invoice-border);
  border-radius: 12px;
  outline: none;
  background: #fffefd;
  color: #68615e;
  font: 400 14px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0;
  text-align: left;
}

input.v2-invoice-control,
textarea.v2-invoice-control {
  padding: 0 12px;
}

.v2-invoice-control::placeholder {
  color: #b3aeaa;
}

.v2-customer-select {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 4px 12px;
}

.v2-customer-select > svg,
.v2-select-wrap > svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.v2-customer-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #f7dce6;
  color: #a77584;
  font-size: 13px;
}

.v2-contact-card {
  position: relative;
  display: grid;
  gap: 15px;
  min-height: 140px;
  margin-top: 12px;
  padding: 21px 20px;
  overflow: hidden;
  border: 1px solid var(--invoice-border);
  border-radius: 13px;
  background: #fcfaf7;
}

.v2-contact-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  color: #625e5b;
  font-size: 15px;
  line-height: 1.5;
}

.v2-contact-row[hidden] {
  display: none;
}

.v2-contact-symbol {
  display: grid;
  width: 18px;
  height: 22px;
  place-items: start center;
  color: var(--invoice-accent-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
}

.v2-contact-symbol svg {
  width: 18px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.v2-contact-sakura {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.v2-invoice-details-column {
  display: grid;
  grid-template-columns: minmax(0, 220px);
  align-content: start;
  gap: 14px;
}

.v2-reference-field {
  width: min(100%, 370px);
}

.v2-date-control {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
}

.v2-live-date-shell {
  position: relative;
  cursor: pointer;
  background: #fffefd;
}

.v2-date-control svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--invoice-dark-brown);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.v2-live-date-display {
  color: #625e5b;
  font: 400 15px/1 Inter, system-ui, sans-serif;
  white-space: nowrap;
}

.v2-live-date-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  opacity: 0;
  cursor: pointer;
  appearance: none;
}

.v2-flexible-date-shell {
  position: relative;
  cursor: text;
  background: #fff;
}

.v2-flexible-date-trigger {
  display: grid;
  flex: 0 0 22px;
  width: 22px;
  height: 100%;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--invoice-dark-brown);
  cursor: pointer;
}

.v2-flexible-date-trigger:focus,
.v2-flexible-date-trigger:focus-visible {
  outline: 0;
  box-shadow: none !important;
}

.v2-flexible-date-input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  box-shadow: none !important;
  background: transparent;
  color: #625e5b;
  font: 400 15px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

.v2-flexible-date-input:focus,
.v2-flexible-date-input:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none !important;
}

.v2-date-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  width: min(286px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(138, 112, 93, 0.24);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(91, 72, 59, 0.16);
  color: var(--invoice-dark-brown);
  cursor: default;
}

.v2-date-popover[hidden] {
  display: none;
}

.v2-date-calendar-header,
.v2-date-calendar-nav,
.v2-date-calendar-weekdays,
.v2-date-calendar-grid {
  display: grid;
  align-items: center;
}

.v2-date-calendar-header {
  grid-template-columns: 1fr auto;
  min-height: 34px;
  margin-bottom: 8px;
}

.v2-date-calendar-header strong {
  font-size: 14px;
  font-weight: 600;
}

.v2-date-calendar-nav {
  grid-auto-flow: column;
  gap: 4px;
}

.v2-date-calendar-nav button,
.v2-date-calendar-day {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.v2-date-calendar-nav button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.v2-date-calendar-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.v2-date-calendar-weekdays,
.v2-date-calendar-grid {
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.v2-date-calendar-weekdays {
  margin-bottom: 4px;
  color: #8a837e;
  font-size: 11px;
  text-align: center;
}

.v2-date-calendar-day,
.v2-date-calendar-blank {
  aspect-ratio: 1;
  min-width: 0;
}

.v2-date-calendar-day {
  border-radius: 8px;
  font: 400 13px/1 Inter, system-ui, sans-serif;
}

.v2-date-calendar-nav button:hover,
.v2-date-calendar-day:hover {
  background: #f6f2eb;
}

.v2-date-calendar-day.is-today {
  box-shadow: inset 0 0 0 1px #bfaf9d;
}

.v2-date-calendar-day.is-selected {
  background: #e9ddcf;
  color: #8a705d;
  font-weight: 600;
}

.v2-flexible-date-input::placeholder {
  color: #b3aeaa;
}

.v2-flexible-date-shell:focus-within {
  border-color: #bfaf9d;
  box-shadow: 0 0 0 3px rgba(191, 175, 157, 0.2);
}

.v2-flexible-date-shell.is-invalid,
.v2-flexible-date-shell:has(.v2-flexible-date-input[aria-invalid="true"]) {
  border-color: #ff808c;
}

.v2-items-section {
  padding: 20px 10px 10px;
}

.v2-items-section > .v2-invoice-section-heading {
  padding: 0 10px;
}

.v2-invoice-line-items {
  display: grid;
  gap: 10px;
}

.v2-invoice-line-item {
  padding: 12px 12px 10px;
  border: 1px solid var(--invoice-border);
  border-radius: 14px;
  background: #fffefd;
}

.v2-line-primary-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(230px, 2.1fr) 60px 120px 92px 32px;
  gap: 12px;
  align-items: start;
}

.v2-line-secondary-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(170px, 1.25fr) minmax(370px, 2.6fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.v2-select-wrap {
  position: relative;
  display: block;
}

.v2-select-wrap select {
  appearance: none;
  padding: 0 34px 0 10px;
}

.v2-select-wrap > svg {
  position: absolute;
  top: 50%;
  right: 10px;
  pointer-events: none;
  transform: translateY(-50%);
}

.v2-line-item-name small,
.v2-line-quantity small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.2;
}

.v2-line-item-name small {
  color: #a58e7c;
}

.v2-line-quantity small {
  color: var(--invoice-accent-text);
}

.v2-line-delete {
  display: grid;
  width: 32px;
  height: 40px;
  align-self: start;
  place-items: center;
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--invoice-accent-text);
}

.v2-line-delete svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.v2-line-calculation {
  display: grid;
  grid-template-columns: minmax(125px, 1fr) 18px minmax(125px, 1fr) 18px minmax(135px, 1fr);
  gap: 3px;
  align-items: start;
}

.v2-line-amount {
  display: grid;
  grid-template-rows: 16px 40px;
  gap: 7px;
}

.v2-line-amount span {
  color: var(--invoice-accent-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 16px;
}

.v2-line-amount strong {
  display: flex;
  min-width: 0;
  height: 40px;
  align-items: center;
  transform: translateY(3px);
  color: #6f6965;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.v2-line-amount.is-total strong {
  color: var(--invoice-accent-text);
  font-size: 14px;
  font-weight: 700;
}

.v2-line-operator {
  display: grid;
  height: 40px;
  align-self: end;
  place-items: center;
  transform: translateY(3px);
  padding: 0;
  color: var(--invoice-accent-text);
  font-size: 15px;
  font-weight: 700;
}

.v2-line-plus {
  color: var(--invoice-green);
}

.v2-add-item-button {
  display: flex;
  width: 100%;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 13px;
  border: 0;
  border-radius: 18px;
  background: #eadbd0;
  color: var(--invoice-accent-text);
  font-size: 14px;
  font-weight: 650;
}

.v2-add-item-button > span:first-child {
  display: inline-flex;
  align-items: center;
}

.v2-add-item-button > svg {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.v2-more-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(240px, 0.9fr);
  gap: clamp(40px, 9vw, 120px);
  align-items: start;
}

.v2-notes-wrap {
  position: relative;
  display: block;
}

.v2-notes-field textarea {
  min-height: 82px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.4;
}

.v2-notes-sakura {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 36px;
  height: 36px;
}

.v2-attachment-field {
  padding-top: 1px;
}

.v2-attach-button {
  display: inline-flex;
  min-width: 190px;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--invoice-border);
  border-radius: 10px;
  background: #fcfaf7;
  color: var(--invoice-accent-text);
  font-size: 14px;
  font-weight: 650;
}

.v2-attach-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.v2-attachment-field p {
  margin: 8px 0 0;
  color: #aaa29d;
  font-size: 12px;
}

.v2-invoice-right-panel {
  position: sticky;
  top: calc(var(--v2-topbar-height) + 14px);
  display: grid;
  gap: 14px;
}

.v2-invoice-side-card {
  padding: 15px 16px;
}

.v2-invoice-side-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.v2-invoice-side-card h2 svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: var(--invoice-accent-text);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.v2-invoice-summary-card h2.is-compact-title {
  gap: 8px;
  font-size: 17px;
  white-space: nowrap;
}

.v2-invoice-summary-card h2.is-compact-title svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
}

.v2-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  margin: 0 0 15px;
  color: #746a65;
  font-size: 14px;
}

.v2-summary-row strong {
  color: #6b6460;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.v2-summary-row strong.is-negative {
  color: var(--invoice-pink);
}

.v2-summary-divider {
  margin: 3px 0 17px;
  border-top: 1px dashed #d9c4b7;
}

.v2-summary-row.is-total {
  align-items: center;
  margin-bottom: 0;
  color: var(--invoice-accent-text);
  font-size: 19px;
  font-weight: 700;
}

.v2-summary-row.is-total strong {
  color: var(--invoice-accent-text);
  font-size: 19px;
  font-weight: 700;
}

.v2-invoice-club-card h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.v2-invoice-club-card h2 svg {
  width: 26px;
  height: 26px;
}

.v2-invoice-club-card p {
  margin: 0;
  color: #6d6864;
  font-size: 14px;
  line-height: 1.45;
}

.v2-invoice-club-card p br {
  display: block;
  margin-top: 20px;
  content: "";
}

.v2-invoice-club-art {
  display: block;
  width: 100%;
  height: 118px;
  margin: 8px auto 4px;
  object-fit: contain;
}

.v2-invoice-club-button {
  display: flex;
  width: 165px;
  height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto;
  border: 0;
  border-radius: 9px;
  background: #eadbd0;
  color: var(--invoice-accent-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.v2-invoice-club-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.v2-invoice-action-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.v2-invoice-action {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--invoice-border);
  border-radius: 10px;
  background: #fffefd;
  color: var(--invoice-accent-text);
  font-size: 14px;
  font-weight: 550;
}

.v2-invoice-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.v2-transaction-action-panel .v2-action-draft {
  background: #fcfaf7;
}

.v2-action-preview {
  border-color: #7db4f0;
  background: #f4faff;
  color: #4e91dc;
}

.v2-action-send,
.v2-action-primary {
  min-height: 67px;
  border-color: #e2cdbf;
  background: #e8d8cd;
  color: var(--invoice-accent-text);
  font-size: 18px;
  font-weight: 650;
}

.v2-invoice-action.v2-action-primary svg {
  width: 24px;
  height: 24px;
}

button,
a,
select {
  cursor: pointer;
}

/* Keep the transaction form's labels, headings and action icons on one calm accent. */
.v2-invoice-entry-page .v2-section-number,
.v2-invoice-entry-page .v2-line-amount span,
.v2-invoice-entry-page .v2-invoice-club-card h2,
.v2-invoice-entry-page .v2-invoice-summary-card h2,
.v2-invoice-entry-page .v2-action-draft,
.v2-invoice-entry-page .v2-action-send,
.v2-invoice-entry-page .v2-action-primary {
  color: var(--invoice-accent-text);
}

@media (max-width: 1250px) {
  .v2-invoice-entry-page {
    padding-inline: 14px;
  }

  .v2-invoice-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 14px;
  }

  .v2-customer-section-grid {
    gap: 36px;
  }

  .v2-line-primary-grid {
    grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.8fr) 54px 104px 82px 30px;
    gap: 8px;
  }

  .v2-line-secondary-grid {
    grid-template-columns: minmax(120px, 1fr) minmax(145px, 1.2fr) minmax(330px, 2.4fr);
    gap: 8px;
  }
}

@media (max-width: 1050px) {
  .v2-invoice-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .v2-invoice-right-panel {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .v2-invoice-action-card {
    align-content: center;
  }
}

@media (max-width: 820px) {
  .v2-invoice-entry-page {
    padding: 12px 10px 28px;
  }

  .v2-invoice-hero {
    grid-template-columns: 1fr;
  }

  .v2-invoice-hero-art {
    height: 100px;
  }

  .v2-customer-section-grid,
  .v2-more-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .v2-invoice-details-column {
    grid-template-columns: 1fr 1fr;
  }

  .v2-reference-field {
    grid-column: 1 / -1;
  }

  .v2-line-primary-grid {
    grid-template-columns: 1fr 1.6fr 70px;
  }

  .v2-line-price,
  .v2-line-discount {
    grid-column: span 1;
  }

  .v2-line-delete {
    grid-column: 3;
    grid-row: 2;
    margin-top: 0;
  }

  .v2-line-secondary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .v2-line-calculation {
    grid-column: 1 / -1;
  }

  .v2-invoice-right-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .v2-invoice-section {
    padding: 16px 12px;
  }

  .v2-invoice-details-column,
  .v2-line-primary-grid,
  .v2-line-secondary-grid {
    grid-template-columns: 1fr;
  }

  .v2-reference-field,
  .v2-line-delete,
  .v2-line-calculation {
    grid-column: 1;
  }

  .v2-line-delete {
    grid-row: auto;
    justify-self: end;
    margin-top: 0;
  }

  .v2-line-calculation {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .v2-line-operator {
    display: none;
  }
}
.v2-invoice-title-accent {
  color: #ff808c;
}

.v2-live-form-error,
.v2-live-field-error {
  border: 1px solid #ffc6cc;
  background: #fff0f1;
  color: #b42332;
}

.v2-live-form-error {
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.v2-live-field-error {
  grid-column: 1 / -1;
  margin-top: 5px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.v2-live-form-error[hidden],
.v2-live-field-error[hidden],
[data-stock-helper][hidden] {
  display: none !important;
}

.v2-invoice-control.is-invalid {
  border-color: #ff9da8;
  background: #fff8f8;
}

.v2-live-date-shell.is-invalid {
  border-color: #ff9da8;
  background: #fff8f8;
}

.v2-live-customer-select,
.v2-live-date-input {
  padding: 0 12px;
  color: var(--v2-brown, #8a705d);
  font: inherit;
}

.v2-customer-select-wrap {
  width: 100%;
}

.v2-invoice-entry-page.is-live-loading .v2-invoice-line-items {
  opacity: 0.55;
}

.v2-invoice-entry-page.is-live-loading select,
.v2-invoice-action:disabled {
  cursor: wait;
  opacity: 0.65;
}
