/* Sales Invoice Phase 2A: module-owned desktop, settings, serial-selection and register styles. */

.invoice-home-eyebrow {
  margin: 0 0 4px;
  color: #4b56d9;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.invoice-home-stat-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.invoice-home-stat-grid .payment-home-stat-card:nth-child(1) {
  background: #fcfbff;
  border-color: #ddd8ff;
}

.invoice-home-stat-grid .payment-home-stat-card:nth-child(1) strong {
  color: #5b4ff8;
}

.invoice-home-stat-grid .payment-home-stat-card:nth-child(2) {
  background: #fffaf4;
  border-color: #f6dfc7;
}

.invoice-home-stat-grid .payment-home-stat-card:nth-child(2) strong {
  color: #ea8a00;
}

.invoice-home-stat-grid .payment-home-stat-card:nth-child(3) {
  background: #f8fbff;
  border-color: #d7e7ff;
}

.invoice-home-stat-grid .payment-home-stat-card:nth-child(3) strong {
  color: #2563eb;
}

.invoice-home-stat-grid .payment-home-stat-card:nth-child(4) {
  background: #f8fdf9;
  border-color: #cfeedd;
}

.invoice-home-stat-grid .payment-home-stat-card:nth-child(4) strong {
  color: #16934a;
}

.invoice-home-stat-grid .payment-home-stat-card:nth-child(5) {
  background: #fbfaff;
  border-color: #e2ddff;
}

.invoice-home-stat-grid .payment-home-stat-card:nth-child(5) strong {
  color: #634cf7;
}

.invoice-home-stat-grid .payment-home-stat-card[data-invoice-home-stat] {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.invoice-home-stat-grid .payment-home-stat-card[data-invoice-home-stat]:hover {
  border-color: #cbd9fb;
  box-shadow: 0 14px 30px rgba(20, 40, 90, 0.12);
  transform: translateY(-1px);
}

.invoice-home-stat-grid .payment-home-stat-card[data-invoice-home-stat]:focus-visible {
  outline: 2px solid #3f46f4;
  outline-offset: 2px;
}

#invoiceHomeBilledAmount {
  font-size: clamp(18px, 1.35vw, 28px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  white-space: nowrap;
  max-width: 100%;
}

.invoice-home-content-grid .serial-home-action-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.invoice-home-content-grid {
  grid-template-columns: minmax(0, 2.15fr) minmax(320px, 0.95fr);
  gap: 18px;
}

.invoice-home-quick-actions-card {
  padding: 12px;
}

.invoice-home-quick-actions-card .serial-home-action-grid {
  gap: 10px;
}

.invoice-home-quick-actions-card .replacement-home-action-tile {
  min-height: 116px;
  padding: 0.76rem;
  border-radius: 12px;
}

.invoice-home-quick-actions-card .replacement-home-action-icon {
  width: 54px;
  height: 54px;
  font-size: 1.35rem;
}

.invoice-home-quick-actions-card .replacement-home-action-copy strong {
  font-size: 1.03rem;
}

.invoice-home-quick-actions-card .replacement-home-action-copy small {
  font-size: 0.88rem;
  line-height: 1.3;
}

.invoice-home-customer-card .payment-home-section-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.invoice-home-customer-card .payment-home-section-head {
  flex-wrap: wrap;
  row-gap: 8px;
}

.invoice-home-customer-card {
  padding: 14px;
}

.invoice-home-customer-card .payment-home-link-btn {
  margin-left: auto;
  white-space: nowrap;
}

.invoice-home-customer-table-wrap {
  max-height: 320px;
  overflow: auto;
}

.invoice-home-activity-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: 560px;
  overflow: hidden;
}

.invoice-home-activity-card .serial-home-activity-list {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.invoice-home-settings-section {
  display: grid;
  gap: 0.95rem;
  padding: 18px;
}

.invoice-settings-page-card {
  display: grid;
  gap: 1rem;
}

.invoice-settings-page-heading {
  align-items: flex-start;
  gap: 0.8rem;
}

.invoice-settings-page-heading .invoice-create-heading-bar {
  justify-content: space-between;
}

.invoice-settings-page .invoice-home-settings-section {
  margin: 0;
}

.invoice-home-settings-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 1px solid #e6edfa;
  padding-bottom: 0.78rem;
}

.invoice-home-settings-heading h2 {
  margin: 0.12rem 0 0;
  font-size: 1.28rem;
  color: #20355f;
}

.invoice-home-settings-status {
  white-space: nowrap;
}

.invoice-home-settings-heading-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.invoice-home-settings-status.is-dirty {
  border-color: #f4d08c;
  background: #fff8e8;
  color: #a76512;
}

.invoice-home-settings-status.is-saved {
  border-color: #cdebd3;
  background: #edf9f0;
  color: #1f8b3f;
}

.invoice-home-print-settings-form {
  display: grid;
  gap: 0.92rem;
}

.invoice-home-print-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.78rem;
}

.invoice-home-print-settings-grid label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  font-size: 0.79rem;
  font-weight: 700;
  color: #4b5f81;
}

.invoice-home-print-settings-grid .full-span {
  grid-column: 1 / -1;
}

.invoice-settings-config-card {
  gap: 1rem;
  padding: 1.05rem;
  border-color: rgba(112, 135, 205, 0.24);
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 92, 255, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  box-shadow: 0 10px 28px rgba(50, 68, 125, 0.06);
}

.invoice-settings-config-card.is-bulk {
  background:
    radial-gradient(circle at 100% 0%, rgba(33, 166, 117, 0.09), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
}

.invoice-settings-section-title {
  display: flex;
  align-items: center;
  gap: 0.78rem;
  min-width: 0;
}

.invoice-settings-section-icon {
  display: inline-grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 2.45rem;
  border: 1px solid rgba(102, 86, 255, 0.2);
  border-radius: 12px;
  background: rgba(111, 92, 255, 0.1);
  color: #5b48dd;
  font-size: 1.05rem;
}

.invoice-settings-config-card.is-bulk .invoice-settings-section-icon {
  border-color: rgba(33, 166, 117, 0.22);
  background: rgba(33, 166, 117, 0.1);
  color: #16865d;
}

.invoice-settings-config-card.is-fields .invoice-settings-section-icon {
  border-color: rgba(47, 128, 237, 0.2);
  background: rgba(47, 128, 237, 0.1);
  color: #256ec9;
}

.invoice-settings-section-tag {
  flex: 0 0 auto;
  border: 1px solid rgba(111, 92, 255, 0.18);
  border-radius: 999px;
  background: rgba(111, 92, 255, 0.08);
  color: #5b48c8;
  padding: 0.3rem 0.58rem;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invoice-settings-config-card.is-bulk .invoice-settings-section-tag {
  border-color: rgba(33, 166, 117, 0.2);
  background: rgba(33, 166, 117, 0.08);
  color: #13724f;
}

.invoice-settings-config-card.is-fields .invoice-settings-section-tag {
  border-color: rgba(47, 128, 237, 0.2);
  background: rgba(47, 128, 237, 0.08);
  color: #245fae;
}

.invoice-action-settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.65rem;
}

.invoice-action-settings-grid .invoice-action-toggle,
.invoice-setting-feature-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.45rem;
  padding: 0.7rem 0.78rem;
  border: 1px solid rgba(118, 139, 200, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 12px rgba(62, 78, 131, 0.04);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.invoice-action-settings-grid .invoice-action-toggle:hover,
.invoice-setting-feature-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 92, 255, 0.38);
  box-shadow: 0 8px 18px rgba(72, 60, 170, 0.09);
}

.invoice-action-settings-grid .invoice-action-toggle:has(input:checked),
.invoice-setting-feature-toggle:has(input:checked) {
  border-color: rgba(111, 92, 255, 0.42);
  background: linear-gradient(135deg, rgba(111, 92, 255, 0.1), rgba(255, 255, 255, 0.96));
  box-shadow: 0 7px 18px rgba(72, 60, 170, 0.1);
}

.invoice-action-settings-grid .invoice-action-toggle input[type="checkbox"],
.invoice-setting-feature-toggle input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 1.15rem;
  margin: 0;
  accent-color: #6f5cff;
}

.invoice-action-settings-grid .invoice-action-toggle > span,
.invoice-setting-feature-toggle > span {
  min-width: 0;
  color: #354b70;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.35;
}

.invoice-action-settings-grid .invoice-action-toggle::after,
.invoice-setting-feature-toggle::after {
  content: "Off";
  flex: 0 0 auto;
  margin-left: auto;
  border-radius: 999px;
  background: #eef1f7;
  color: #77839d;
  padding: 0.22rem 0.46rem;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.invoice-action-settings-grid .invoice-action-toggle:has(input:checked)::after,
.invoice-setting-feature-toggle:has(input:checked)::after {
  content: "On";
  background: #e7e3ff;
  color: #5c48d8;
}

.invoice-setting-feature-toggle {
  width: min(100%, 620px);
}

.invoice-settings-config-card.is-bulk .invoice-setting-feature-toggle:has(input:checked) {
  border-color: rgba(33, 166, 117, 0.4);
  background: linear-gradient(135deg, rgba(33, 166, 117, 0.1), rgba(255, 255, 255, 0.96));
  box-shadow: 0 7px 18px rgba(20, 124, 86, 0.09);
}

.invoice-settings-config-card.is-bulk .invoice-setting-feature-toggle:has(input:checked)::after {
  background: #dff6ec;
  color: #147552;
}

.invoice-template-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.invoice-template-preset-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  border: 1px solid rgba(118, 139, 200, 0.28);
  border-radius: 13px;
  background: #fff;
  color: #273b60;
  padding: 0.62rem;
  text-align: left;
  cursor: default;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.invoice-template-preset-card:hover {
  transform: translateY(-1px);
  border-color: rgba(55, 95, 184, 0.48);
  box-shadow: 0 8px 18px rgba(47, 75, 135, 0.1);
}

.invoice-template-preset-card.is-selected {
  border-color: #315fc4;
  box-shadow: 0 0 0 3px rgba(49, 95, 196, 0.13);
}

.invoice-template-preset-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.invoice-template-preset-card strong {
  font-size: 0.85rem;
  color: #20355f;
}

.invoice-template-preset-card small {
  color: #71809c;
  font-size: 0.69rem;
  font-weight: 600;
  line-height: 1.3;
}

.invoice-template-preset-preview {
  --preset-header: #ffffff;
  --preset-accent: #4a4a4a;
  --preset-table: #f3f3f3;
  position: relative;
  display: block;
  width: 72px;
  height: 52px;
  overflow: hidden;
  border: 1px solid #dce3ef;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(35, 53, 91, 0.08);
}

.invoice-template-preset-preview::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 16px;
  background: var(--preset-header);
  border-bottom: 2px solid var(--preset-accent);
}

.invoice-template-preset-preview i,
.invoice-template-preset-preview b,
.invoice-template-preset-preview em {
  position: absolute;
  display: block;
  border-radius: 2px;
}

.invoice-template-preset-preview i {
  top: 6px;
  left: 17px;
  width: 38px;
  height: 4px;
  background: var(--preset-accent);
}

.invoice-template-preset-preview b {
  top: 23px;
  left: 7px;
  width: 58px;
  height: 10px;
  background: var(--preset-table);
  border: 1px solid rgba(79, 95, 126, 0.16);
}

.invoice-template-preset-preview em {
  top: 38px;
  right: 7px;
  width: 25px;
  height: 6px;
  background: var(--preset-table);
}

.preset-modern .invoice-template-preset-preview {
  --preset-header: #123b66;
  --preset-accent: #2f80ed;
  --preset-table: #eaf3ff;
}

.preset-emerald .invoice-template-preset-preview {
  --preset-header: #0f5132;
  --preset-accent: #21a675;
  --preset-table: #e2f6ed;
}

.preset-executive .invoice-template-preset-preview {
  --preset-header: #2d241a;
  --preset-accent: #c79b42;
  --preset-table: #f5ead5;
}

.preset-custom .invoice-template-preset-preview {
  --preset-header: #4c3f78;
  --preset-accent: #8b6de8;
  --preset-table: #f1edff;
}

.invoice-template-preset-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.42rem;
  padding-top: 0.12rem;
}

.invoice-template-preset-actions .small-btn {
  min-width: 4.7rem;
  justify-content: center;
}

.invoice-template-preview-btn {
  background: #eef4ff;
  color: #274f9b;
  border-color: #cad9f6;
}

.preset-modern .invoice-template-preset-preview i,
.preset-emerald .invoice-template-preset-preview i,
.preset-executive .invoice-template-preset-preview i {
  background: #ffffff;
}

.invoice-home-print-settings-grid input,
.invoice-home-print-settings-grid select,
.invoice-home-print-settings-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(118, 139, 200, 0.32);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: #253656;
  font: 600 0.86rem "Inter", "Manrope", sans-serif;
  padding: 0.58rem 0.66rem;
}

.invoice-home-print-settings-grid input[type="color"] {
  min-height: 42px;
  padding: 4px;
  cursor: pointer;
}

.invoice-home-print-settings-grid .field-control > input,
.invoice-home-print-settings-grid .field-control > select,
.invoice-home-print-settings-grid .field-control > textarea {
  padding-left: 2.6rem;
}

.invoice-home-print-settings-grid .field-control .field-icon {
  left: 0.66rem;
}

.invoice-home-print-settings-grid textarea {
  resize: vertical;
  min-height: 76px;
}

.invoice-home-signature-row {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  align-items: end;
  gap: 0.68rem;
}

.invoice-home-signature-preview {
  min-height: 96px;
  border-radius: 12px;
}

.invoice-home-signature-row .action-row {
  margin: 0;
  justify-content: flex-end;
  gap: 0.52rem;
}

.invoice-home-signature-row .secondary-btn,
.invoice-home-signature-row .primary-btn {
  min-height: 2.25rem;
  padding: 0.52rem 0.78rem;
  border-radius: 10px;
}

.invoice-settings-saas-shell {
  padding: 0;
  overflow: visible;
  border-color: #dbe3ef;
  background: #f8fafc;
}

.invoice-settings-workspace-form {
  position: relative;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.invoice-settings-sidebar {
  position: sticky;
  top: 14px;
  align-self: start;
  align-content: start;
  display: grid;
  gap: 0.78rem;
  min-height: calc(100vh - 160px);
  padding: 1rem;
  border-right: 1px solid #e2e8f0;
  border-radius: 8px 0 0 8px;
  background: #ffffff;
}

.invoice-settings-nav {
  display: grid;
  gap: 0.22rem;
}

.invoice-settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  width: 100%;
  min-height: 2.45rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font: 800 0.83rem "Inter", "Manrope", sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.invoice-settings-nav-btn:hover,
.invoice-settings-nav-btn.is-active {
  background: #eef4ff;
  color: #1d4ed8;
}

.invoice-settings-nav-btn:active {
  transform: translateY(1px);
}

.invoice-settings-nav-btn i {
  width: 1.15rem;
  text-align: center;
}

.invoice-settings-content {
  display: grid;
  gap: 0.86rem;
  min-width: 0;
  padding: 1.05rem;
}

.invoice-settings-panel {
  display: grid;
  gap: 0.78rem;
  min-width: 0;
  animation: invoiceSettingsPanelIn 0.16s ease;
}

.invoice-settings-panel[hidden],
.invoice-settings-tab-panel[hidden] {
  display: none;
}

.invoice-settings-panel-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.78rem;
  padding: 0.2rem 0.2rem 0.36rem;
}

.invoice-settings-panel-head > span {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid #d7e4fb;
  border-radius: 8px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 1.15rem;
}

.invoice-settings-panel-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1.24rem;
  line-height: 1.2;
}

.invoice-settings-panel-head p,
.invoice-settings-muted-copy p {
  margin: 0.22rem 0 0;
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.45;
}

.invoice-settings-accordion {
  overflow: hidden;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.invoice-settings-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  list-style: none;
  padding: 0.86rem 1rem;
  color: #1e293b;
  font-weight: 850;
  cursor: pointer;
}

.invoice-settings-accordion summary::-webkit-details-marker {
  display: none;
}

.invoice-settings-accordion summary > span {
  display: flex;
  align-items: center;
  gap: 0.58rem;
  min-width: 0;
}

.invoice-settings-accordion summary .bi-chevron-down {
  color: #94a3b8;
  transition: transform 0.16s ease;
}

.invoice-settings-accordion[open] summary .bi-chevron-down {
  transform: rotate(180deg);
}

.invoice-settings-card-body {
  padding: 0.92rem 1rem 1rem;
  border-top: 1px solid #edf2f7;
}

.invoice-settings-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.78rem;
}

.invoice-settings-field-grid label,
.invoice-settings-workspace-form label:not(.designer-toggle):not(.invoice-template-preset-card) {
  display: grid;
  gap: 0.36rem;
  min-width: 0;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 800;
}

.invoice-settings-field-grid .full-span,
.invoice-settings-workspace-form .full-span {
  grid-column: 1 / -1;
}

.invoice-settings-workspace-form input:not([type="checkbox"]):not([type="color"]):not([type="search"]),
.invoice-settings-workspace-form select,
.invoice-settings-workspace-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd9e8;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  font: 700 0.86rem "Inter", "Manrope", sans-serif;
  padding: 0.6rem 0.7rem;
}

.invoice-settings-workspace-form input[type="color"] {
  width: 100%;
  min-height: 2.55rem;
  border: 1px solid #cfd9e8;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.25rem;
  cursor: pointer;
}

.invoice-settings-workspace-form textarea {
  min-height: 82px;
  resize: vertical;
}

.invoice-settings-workspace-form .field-control .field-icon {
  left: 0.7rem;
}

.invoice-settings-workspace-form .field-control > input:not([type="checkbox"]):not([type="color"]):not([type="search"]),
.invoice-settings-workspace-form .field-control > select,
.invoice-settings-workspace-form .field-control > textarea {
  padding-left: 2.75rem;
}

.invoice-settings-workspace-form .field-control > input[type="color"] {
  padding-left: 0.25rem;
}

.invoice-settings-workspace-form small {
  color: #64748b;
  font-weight: 650;
  line-height: 1.4;
}

.invoice-settings-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.invoice-settings-primary-grid {
  margin-bottom: 0.78rem;
}

.invoice-settings-checkbox-grid .invoice-action-toggle,
.invoice-settings-workspace-form .invoice-setting-feature-toggle {
  width: 100%;
  min-height: 2.75rem;
  border-radius: 8px;
  box-shadow: none;
}

.invoice-settings-workspace-form .invoice-action-toggle::after,
.invoice-settings-workspace-form .invoice-setting-feature-toggle::after {
  display: none;
  content: none;
}

.invoice-settings-segmented {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.25rem;
}

.invoice-settings-segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font: 850 0.8rem "Inter", "Manrope", sans-serif;
  padding: 0.5rem 0.76rem;
  cursor: pointer;
}

.invoice-settings-segmented button.is-active {
  background: #1d4ed8;
  color: #ffffff;
}

.invoice-number-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.78rem;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  padding: 0.8rem 0.9rem;
}

.invoice-number-preview-card span {
  color: #cbd5e1;
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.invoice-number-preview-card strong {
  overflow-wrap: anywhere;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.invoice-settings-save-bar {
  position: relative;
  z-index: 15;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-top: 1px solid #dbe4f0;
  border-radius: 0 0 8px 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  padding: 0.76rem 1rem;
}

.invoice-settings-save-bar > span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #1f8b3f;
  font-size: 0.82rem;
  font-weight: 850;
}

.invoice-settings-save-bar > span i {
  display: none;
}

.invoice-settings-save-bar > span::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: currentColor;
}

.invoice-settings-save-bar > span.is-dirty {
  color: #a76512;
}

.invoice-settings-save-bar .action-row {
  margin: 0;
}

@keyframes invoiceSettingsPanelIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .invoice-settings-workspace-form {
    grid-template-columns: 1fr;
  }

  .invoice-settings-sidebar {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
  }

  .invoice-settings-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    overflow-x: auto;
    padding-bottom: 0.12rem;
  }
}

@media (max-width: 680px) {
  .invoice-settings-content {
    padding: 0.82rem;
  }

  .invoice-settings-field-grid,
  .invoice-settings-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .invoice-settings-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .invoice-settings-save-bar .action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
}
.invoice-home-customer-table-wrap table {
  min-width: 660px;
}

.invoice-home-customer-table-wrap th {
  padding: 12px 14px;
  font-size: 12px;
}

.invoice-home-customer-table-wrap td {
  padding: 12px 14px;
  font-size: 13px;
}

.invoice-home-customer-table-wrap th:first-child,
.invoice-home-customer-table-wrap td:first-child {
  text-align: left;
}

.invoice-home-customer-table-wrap th:nth-child(n + 2),
.invoice-home-customer-table-wrap td:nth-child(n + 2) {
  text-align: right;
  white-space: nowrap;
}

.invoice-home-customer-table-wrap td:nth-child(4) {
  font-weight: 700;
}

.invoice-home-insights-card .serial-home-insight-head strong {
  font-size: 24px;
}

.invoice-home-insights-card .serial-home-insight-head span {
  font-size: 15px;
}

.invoice-panel-card {
  border-color: #dce7dd;
  background: linear-gradient(180deg, #f9fcf9 0%, #f4f8f4 100%);
  box-shadow: 0 16px 34px rgba(45, 88, 52, 0.08);
}

.invoice-panel-card > .panel-heading.invoice-create-heading {
  gap: 0.8rem;
  margin-bottom: 0.95rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.invoice-create-heading-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.72rem;
  padding: 0.05rem 0.05rem 0.78rem;
  border-bottom: 1px solid #dfe8df;
}

.invoice-panel-card > .panel-heading.invoice-create-heading.is-register-view {
  justify-content: flex-end;
}

.invoice-panel-card > .panel-heading.invoice-create-heading.is-register-view .invoice-create-heading-bar {
  margin-left: auto;
  padding-bottom: 0;
  border-bottom: 0;
}

.invoice-panel-card #invoiceBackToHomeBtn {
  min-height: 2.15rem;
  padding: 0.35rem 0.2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #2d6d3d;
  box-shadow: none;
  font-size: 0.95rem;
  font-weight: 700;
}

.invoice-panel-card #invoiceBackToHomeBtn i {
  font-size: 0.92rem;
}

.invoice-panel-card #invoiceMode {
  align-self: center;
  min-height: 2.1rem;
  padding: 0.44rem 0.84rem;
  border-radius: 9px;
  border: 1px solid #93caa1;
  background: #ecf8ef;
  color: #1f8b3f;
  box-shadow: none;
  font-size: 0.87rem;
  font-weight: 700;
}

.invoice-create-heading-copy h2 {
  margin: 0;
  font-family: "Inter", "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.6rem, 1.45rem + 0.54vw, 2rem);
  line-height: 1.2;
  color: #1f2c25;
  letter-spacing: -0.01em;
}

.invoice-create-heading-copy p {
  margin: 0.3rem 0 0;
  color: #495c52;
  font-size: 1rem;
}

.invoice-panel-card #invoiceCreatePanel {
  display: grid;
  gap: 0.95rem;
}

.invoice-panel-card .tally-invoice-form {
  gap: 0.9rem;
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.invoice-panel-card .tally-voucher-bar,
.invoice-panel-card .tally-customer-strip,
.invoice-panel-card .tally-items-header,
.invoice-panel-card .tally-line-items-wrapper,
.invoice-panel-card .tally-ledger-lines,
.invoice-panel-card .tally-summary-panel {
  border: 1px solid #dbe5dc;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(64, 96, 72, 0.05);
}

.invoice-panel-card .tally-voucher-bar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: start;
  padding: 0.95rem;
}

.invoice-panel-card .tally-voucher-type {
  display: none;
}

.invoice-panel-card .tally-voucher-bar label {
  gap: 0.46rem;
  color: #26352f;
  font-size: 0.95rem;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
}

.invoice-panel-card .tally-customer-strip {
  grid-template-columns: minmax(130px, 0.72fr) minmax(220px, 1.35fr) minmax(180px, 1fr);
  gap: 0.88rem;
  padding: 0.95rem;
}

.invoice-panel-card .tally-section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  margin: -0.05rem 0 0.05rem;
  color: #258141;
  font-size: 1.34rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.invoice-panel-card .tally-section-title i {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #258141;
  background: #ecf7ee;
  border: 1px solid #c8e4cf;
  font-size: 0.82rem;
}

.invoice-panel-card .tally-customer-strip label,
.invoice-panel-card .tally-ledger-lines label {
  gap: 0.45rem;
  color: #26352f;
  font-size: 0.95rem;
  font-weight: 650;
}

.invoice-panel-card label .field-optional {
  color: #7f8e85;
  font-size: 0.85rem;
  font-weight: 600;
}

.invoice-panel-card input,
.invoice-panel-card select,
.invoice-panel-card textarea {
  min-height: 2.85rem;
  border-radius: 10px;
  border-color: #d7e1d9;
  background: #ffffff;
  color: #203028;
  font-size: 0.95rem;
  box-shadow: none;
}

.invoice-panel-card input::placeholder,
.invoice-panel-card textarea::placeholder {
  color: #a6b2aa;
}

.invoice-panel-card input:focus,
.invoice-panel-card select:focus,
.invoice-panel-card textarea:focus {
  border-color: #79bc8b;
  box-shadow: 0 0 0 3px rgba(74, 163, 98, 0.16);
}

.invoice-panel-card input[readonly],
.invoice-panel-card textarea[readonly] {
  background: #f8fbf8;
  color: #4a5d51;
}

.invoice-panel-card .field-control .field-icon {
  color: #6e7e74;
  background: #f4f8f4;
  border-color: #d8e4da;
}

.invoice-panel-card .field-control > input,
.invoice-panel-card .field-control > select,
.invoice-panel-card .field-control > textarea {
  padding-left: 2.5rem;
}

.invoice-panel-card .tally-items-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem 0.95rem;
}

.invoice-panel-card .tally-items-heading-copy h3 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  color: #258141;
  font-size: 1.32rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.invoice-panel-card .tally-items-heading-copy h3 i {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #258141;
  background: #ecf7ee;
  border: 1px solid #c8e4cf;
  font-size: 0.82rem;
}

.invoice-panel-card .tally-items-header .add-row-controls {
  align-items: center;
  gap: 0.55rem;
}

.invoice-panel-card .tally-keyboard-mode-toggle {
  min-height: 2.25rem;
  padding: 0.26rem 0.72rem;
  border-radius: 10px;
  border-color: #c8dfcf;
  background: #f4f9f5;
  color: #2a4634;
  font-size: 0.9rem;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
}

.invoice-panel-card .add-row-count {
  min-height: 2.25rem;
  padding: 0.2rem 0.32rem 0.2rem 0.6rem;
  border: 1px solid #d6e0d8;
  border-radius: 10px;
  background: #ffffff;
  color: #42554a;
  font-size: 0.86rem;
}

.invoice-panel-card #addInvoiceItemCount {
  min-width: 76px;
  min-height: 2.05rem;
}

.invoice-panel-card .line-items-table input,
.invoice-panel-card .line-items-table select {
  min-height: 2.35rem;
  font-size: 0.94rem;
}

.invoice-panel-card .tally-line-items-wrapper {
  overflow: auto;
}

.invoice-panel-card .tally-line-items-table thead th {
  background: #edf5ed;
  color: #2f5e3d;
  border-bottom: 1px solid #d6e3d9;
  font-size: 0.87rem;
  text-transform: none;
  letter-spacing: 0;
}

.invoice-panel-card .tally-line-items-table tbody td {
  background: #ffffff;
  border-bottom: 1px solid #edf3ee;
}

.invoice-panel-card .tally-line-items-table tbody tr:nth-child(even) td {
  background: #fcfefc;
}

.invoice-panel-card .tally-line-items-table tfoot td {
  padding: 0.65rem 0.7rem;
  border-top: 1px solid #d6e3d9;
  background: #edf5ed;
  color: #2f5e3d;
  text-align: right;
  font-weight: 800;
}

.invoice-panel-card .tally-line-items-table tfoot td:nth-child(4) {
  color: #1f8b3f;
}

.invoice-panel-card .invoice-items-footer-actions {
  margin-top: -0.15rem;
  gap: 0.55rem;
}

.invoice-master-create-actions {
  justify-content: flex-start;
  margin-top: -0.15rem;
}

.invoice-master-create-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0.58rem 0.9rem;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(18, 49, 86, 0.16);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.invoice-master-create-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 10px 22px rgba(18, 49, 86, 0.22);
}

.invoice-master-create-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.invoice-create-ledger-btn {
  background: #2563eb;
}

.invoice-create-item-btn {
  background: #d97706;
}

.quotation-master-create-actions,
.quotation-item-create-actions {
  justify-content: flex-start;
  margin-top: 0.55rem;
}

.line-item-description-preview {
  display: block;
  margin-top: 0.32rem;
  color: #7b879f;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
}

.line-item-description-preview[hidden] {
  display: none;
}

.invoice-panel-card .tally-ledger-footer {
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 0.8rem;
}

.invoice-panel-card .tally-ledger-lines {
  padding: 0.88rem;
  gap: 0.78rem;
}

.invoice-panel-card .invoice-additional-entries {
  border: 1px solid #d9e5dc;
  border-radius: 12px;
  background: #fdfefd;
  padding: 0.72rem;
}

.invoice-panel-card .invoice-additional-entries-header strong {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #2a7a40;
  font-size: 1.18rem;
  font-weight: 740;
}

.invoice-panel-card .invoice-additional-entries-header strong i {
  width: 1.42rem;
  height: 1.42rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2a7a40;
  background: #ecf7ee;
  border: 1px solid #c8e4cf;
  font-size: 0.8rem;
}

.invoice-panel-card .invoice-additional-entries-hint {
  color: #708377;
}

.invoice-panel-card .invoice-additional-entry-row {
  gap: 0.52rem;
}

.invoice-panel-card .tally-summary-panel {
  padding: 0.86rem;
  display: grid;
  gap: 0.55rem;
}

.invoice-panel-card .tally-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  color: #2a7a40;
  font-size: 1.18rem;
  font-weight: 740;
}

.invoice-panel-card .tally-summary-title i {
  width: 1.42rem;
  height: 1.42rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2a7a40;
  background: #ecf7ee;
  border: 1px solid #c8e4cf;
  font-size: 0.8rem;
}

.invoice-panel-card .tally-totals-list {
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: 0.36rem;
}

.invoice-panel-card .tally-totals-list div {
  min-height: 2rem;
  align-items: center;
  border-bottom: 1px dashed #e0e8e2;
  font-size: 0.98rem;
  color: #41564a;
  padding: 0.06rem 0;
}

.invoice-panel-card .tally-totals-list div:last-child {
  margin-top: 0.35rem;
  padding: 0.6rem 0.72rem;
  border: 1px solid #cde5d4;
  border-radius: 10px;
  background: #ecf8ef;
  color: #1f8b3f;
  font-weight: 700;
}

.invoice-panel-card .tally-totals-list strong {
  color: #22392e;
  font-size: 1.01rem;
  font-weight: 700;
}

.invoice-panel-card .tally-totals-list .invoice-tcs-summary-row {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) minmax(18rem, auto);
  gap: 1.25rem;
  padding: 0.45rem 0;
}

.invoice-panel-card .invoice-tcs-rate-edit,
.invoice-panel-card .invoice-tcs-amount-edit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  min-width: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
}

.invoice-panel-card .invoice-tcs-rate-control,
.invoice-panel-card .invoice-tcs-amount-control {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.invoice-panel-card .invoice-tcs-rate-control {
  gap: 0.35rem;
}

.invoice-panel-card #invoiceTcsRate {
  width: 5.8rem;
  min-height: 2.25rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid #c8d9cc;
  border-radius: 8px;
  background: #fff;
  text-align: right;
  font: inherit;
  box-sizing: border-box;
  appearance: textfield;
}

.invoice-panel-card .invoice-tcs-amount-edit small {
  color: #879389;
  font-size: 0.78rem;
  font-weight: 600;
}

.invoice-panel-card .invoice-tcs-amount-control {
  width: 10rem;
  min-height: 2.35rem;
  align-items: center;
  overflow: hidden;
  border: 1px solid #c8d9cc;
  border-radius: 9px;
  background: #fff;
  box-sizing: border-box;
}

.invoice-panel-card .invoice-tcs-currency {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 2.25rem;
  flex: 0 0 2.25rem;
  color: #5c6b61;
  background: #f3f7f3;
  border-right: 1px solid #dce6de;
  font-weight: 700;
}

.invoice-panel-card #invoiceTcsAmount {
  width: auto;
  min-width: 0;
  min-height: 2.25rem;
  flex: 1 1 auto;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: right;
  font: inherit;
  font-weight: 800;
  color: #17356f;
  box-sizing: border-box;
  appearance: textfield;
}

.invoice-panel-card #invoiceTcsRate::-webkit-inner-spin-button,
.invoice-panel-card #invoiceTcsRate::-webkit-outer-spin-button,
.invoice-panel-card #invoiceTcsAmount::-webkit-inner-spin-button,
.invoice-panel-card #invoiceTcsAmount::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.invoice-panel-card #invoiceTcsAmount:focus {
  border: 0;
  box-shadow: none;
  outline: none;
}

.invoice-panel-card .invoice-tcs-amount-control:focus-within {
  border-color: #79bc8b;
  box-shadow: 0 0 0 3px rgba(74, 163, 98, 0.16);
}

@media (max-width: 720px) {
  .invoice-panel-card .tally-totals-list .invoice-tcs-summary-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
  }

  .invoice-panel-card .invoice-tcs-rate-edit,
  .invoice-panel-card .invoice-tcs-amount-edit {
    width: 100%;
  }
}

.invoice-panel-card .invoice-additional-summary-row.is-income strong {
  color: #1f7a3c;
}

.invoice-panel-card .invoice-additional-summary-row.is-expense strong {
  color: #a33b32;
}

.invoice-panel-card .tally-totals-list div:last-child strong,
.invoice-panel-card #invoiceGrandTotal {
  color: #1f8b3f;
  font-size: 2rem;
  font-weight: 800;
}

.invoice-panel-card .invoice-total-input-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.22rem;
  margin-left: auto;
}

.invoice-panel-card .invoice-total-input-wrap > span {
  color: #1f8b3f;
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1;
}

.invoice-panel-card #invoiceGrandTotal {
  width: 170px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: right;
}

.invoice-autofill-guard {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.invoice-autofill-guard input {
  position: absolute;
  left: -99999px;
  top: -99999px;
  width: 1px;
  height: 1px;
  border: 0;
  padding: 0;
}

.invoice-panel-card .payment-status-line {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0.1rem 0 0.15rem;
  color: #53665a;
  font-size: 0.96rem;
}

.invoice-panel-card #invoiceFormStatus {
  display: inline-flex;
  align-items: center;
  min-height: 1.88rem;
  padding: 0.18rem 0.62rem;
  border-radius: 8px;
  border: 1px solid #cde5d4;
  background: #ecf8ef;
  color: #1f8b3f;
  font-size: 0.9rem;
  font-weight: 700;
}

.invoice-panel-card .invoice-print-pref-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0.05rem 0 0.1rem;
}

.invoice-panel-card .invoice-print-pref {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.14rem;
  padding: 0.22rem 0.58rem;
  border: 1px solid #d6e2d9;
  border-radius: 10px;
  background: #ffffff;
  color: #3f5448;
  font-size: 0.86rem;
  font-weight: 620;
}

.invoice-panel-card .invoice-print-pref input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: #1f8b3f;
}

.invoice-panel-card #invoiceDirectPrintBtn {
  border-color: #c4ddca;
  background: #f5faf6;
  color: #2c6f3e;
}

.invoice-panel-card .action-row {
  margin-top: 0.1rem;
  gap: 0.55rem;
}

.invoice-panel-card .primary-btn,
.invoice-panel-card .secondary-btn,
.invoice-panel-card .ghost-btn {
  min-height: 2.4rem;
  padding: 0.58rem 0.94rem;
  border-radius: 10px;
  box-shadow: none;
}

.invoice-panel-card .primary-btn {
  border: 1px solid #248744;
  background: linear-gradient(135deg, #3faa5f, #1f8b3f);
  color: #ffffff;
}

.invoice-panel-card .secondary-btn {
  border: 1px solid #c6dcc9;
  background: #f4f9f5;
  color: #2d6d3d;
}

.invoice-panel-card .ghost-btn {
  border: 1px solid #d4dfd6;
  background: #ffffff;
  color: #3f5448;
}

.invoice-panel-card #invoiceValidateBtn,
.invoice-panel-card #invoiceSubmitBtn {
  border-color: #248744;
  background: linear-gradient(135deg, #3faa5f, #1f8b3f);
  color: #ffffff;
}

.invoice-panel-card #addInvoiceItemBtn,
.invoice-panel-card #invoiceAddEntryBtn {
  border-color: #c4ddca;
  background: #f5faf6;
  color: #2c6f3e;
}

.invoice-panel-card #resetInvoiceBtn {
  border-color: #d0dbd3;
  background: #ffffff;
  color: #34493e;
}

.invoice-panel-card .invoice-shortcuts-card {
  border: 1px solid #dbe5dc;
  border-radius: 14px;
  background: #f7fbf8;
  padding: 0.9rem 0.95rem;
  display: grid;
  gap: 0.72rem;
}

.invoice-panel-card .invoice-shortcuts-head {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
}

.invoice-panel-card .invoice-shortcuts-head i {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2a7a40;
  background: #ecf7ee;
  border: 1px solid #c8e4cf;
  font-size: 0.78rem;
}

.invoice-panel-card .invoice-shortcuts-head h3 {
  margin: 0;
  font-size: 1.22rem;
  color: #2a7a40;
}

.invoice-panel-card .invoice-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}

.invoice-panel-card .invoice-shortcuts-grid > div {
  min-height: 2.46rem;
  border: 1px solid #deeadf;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  padding: 0.3rem 0.56rem;
}

.invoice-panel-card .invoice-shortcuts-grid kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  min-height: 1.48rem;
  padding: 0.12rem 0.42rem;
  border-radius: 7px;
  border: 1px solid #d4e5d8;
  background: #f0f8f2;
  color: #2f6a3e;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: "Inter", "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: none;
}

.invoice-panel-card .invoice-shortcuts-grid span {
  color: #4f6358;
  font-size: 0.83rem;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 1280px) {
  .invoice-panel-card .invoice-shortcuts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .invoice-panel-card .tally-voucher-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invoice-panel-card .tally-ledger-footer {
    grid-template-columns: 1fr;
  }

  .invoice-panel-card .tally-items-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .invoice-panel-card .tally-items-header .add-row-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .invoice-create-heading-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .invoice-panel-card #invoiceBackToHomeBtn,
  .invoice-panel-card #invoiceMode {
    justify-content: center;
    width: 100%;
  }

  .invoice-panel-card .tally-voucher-bar,
  .invoice-panel-card .tally-customer-strip {
    grid-template-columns: 1fr;
  }

  .invoice-panel-card .invoice-total-input-wrap {
    width: 100%;
    justify-content: flex-end;
  }

  .invoice-panel-card #invoiceGrandTotal {
    width: 130px;
  }

  .invoice-panel-card .invoice-print-pref,
  .invoice-panel-card #invoiceDirectPrintBtn {
    width: 100%;
    justify-content: center;
  }

  .invoice-panel-card .action-row > .primary-btn,
  .invoice-panel-card .action-row > .secondary-btn,
  .invoice-panel-card .action-row > .ghost-btn {
    width: 100%;
    justify-content: center;
  }
}

.invoice-serial-item-list {
  display: grid;
  gap: 0.8rem;
  max-height: min(62vh, 760px);
  overflow-y: auto;
  padding-right: 0.2rem;
}

.invoice-serial-item-card {
  border: 1px solid rgba(113, 130, 196, 0.26);
  border-radius: 14px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.66);
  display: grid;
  gap: 0.65rem;
}

.invoice-serial-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.invoice-serial-item-head strong {
  color: var(--text);
}

.invoice-serial-qty-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(73, 101, 226, 0.12);
  color: var(--text);
  font-weight: 700;
  font-size: 0.86rem;
}

.invoice-serial-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 0.55rem;
  align-items: end;
}

.invoice-serial-bulk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.55rem;
  align-items: end;
}

.invoice-serial-entry-row .small-btn,
.invoice-serial-bulk-row .small-btn {
  white-space: nowrap;
}

.invoice-serial-item-card textarea {
  min-height: 84px;
}

.invoice-serial-selected {
  border: 1px dashed rgba(113, 130, 196, 0.35);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  background: rgba(255, 255, 255, 0.64);
}

.invoice-serial-selected-label {
  display: block;
  margin-bottom: 0.32rem;
  font-weight: 700;
  color: var(--text);
  font-size: 0.86rem;
}

.invoice-serial-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.invoice-serial-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(113, 130, 196, 0.35);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 0.2rem 0.56rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.invoice-serial-chip button {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-weight: 700;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

.invoice-serial-chip button:hover {
  color: var(--danger);
}

.invoice-serial-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.invoice-serial-item-meta strong {
  color: var(--text);
}

@media (max-width: 900px) {
  .invoice-serial-entry-row,
  .invoice-serial-bulk-row {
    grid-template-columns: 1fr;
  }
}

#invoiceViewPanel {
  display: grid;
  gap: 1rem;
}

#invoiceViewPanel .invoice-register-actions {
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(79, 107, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

#invoiceViewPanel .invoice-register-actions .primary-btn {
  min-height: 44px;
  border-radius: 12px;
  box-shadow: 0 12px 22px rgba(34, 139, 83, 0.18);
}

#invoiceViewPanel .invoice-register-note {
  flex: 1 1 520px;
  margin: 0;
  color: #607092;
  font-size: 0.9rem;
}

#invoiceViewPanel .invoice-bulk-verification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(34, 139, 83, 0.22);
  border-radius: 14px;
  background: rgba(232, 248, 239, 0.78);
}

#invoiceViewPanel .invoice-bulk-verification-toolbar[hidden] {
  display: none;
}

#invoiceViewPanel .invoice-bulk-verification-toolbar .action-row {
  margin: 0;
}

#invoiceViewPanel .invoice-bulk-verification-toolbar .success {
  color: #13844a;
  border-color: #bfe4cc;
}

.invoice-register-select-cell {
  width: 3rem;
  text-align: center;
}

.invoice-register-select-cell input {
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
}

#invoiceViewPanel .invoice-register-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(160px, 190px) minmax(150px, 180px) minmax(150px, 180px) auto;
  gap: 0.7rem;
  align-items: end;
  margin: 0;
  padding: 0.9rem;
  border: 1px solid rgba(121, 142, 202, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

#invoiceViewPanel .invoice-register-search {
  min-width: 0;
}

#invoiceViewPanel .invoice-register-search input[type="search"],
#invoiceViewPanel .compact-filter select,
#invoiceViewPanel .compact-filter input[type="date"],
#invoiceViewPanel #invoiceClearDateFilterBtn {
  min-height: 46px;
  border-radius: 12px;
  border-color: rgba(121, 142, 202, 0.26);
  background-color: rgba(255, 255, 255, 0.94);
}

#invoiceViewPanel .invoice-register-search input[type="search"]:focus,
#invoiceViewPanel .compact-filter select:focus,
#invoiceViewPanel .compact-filter input[type="date"]:focus {
  border-color: rgba(79, 107, 255, 0.52);
  box-shadow: 0 0 0 4px rgba(79, 107, 255, 0.12);
}

#invoiceViewPanel .compact-filter {
  min-width: 0;
  gap: 0.28rem;
  color: #607092;
  font-size: 0.8rem;
}

#invoiceViewPanel .compact-filter select,
#invoiceViewPanel .compact-filter input[type="date"] {
  min-width: 0;
  width: 100%;
}

#invoiceViewPanel #invoiceClearDateFilterBtn {
  align-self: end;
  white-space: nowrap;
  color: #30415f;
  background: #f3f6f9;
}

#invoiceViewPanel .invoice-register-table {
  border: 1px solid rgba(121, 142, 202, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.07);
}

#invoiceViewPanel .invoice-register-table table {
  min-width: 1060px;
  border-collapse: separate;
  border-spacing: 0;
}

#invoiceViewPanel .invoice-register-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.9rem 1rem;
  background: #f8fafc;
  color: #5d6b89;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(121, 142, 202, 0.2);
}

#invoiceViewPanel .invoice-register-table td {
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(121, 142, 202, 0.13);
}

#invoiceViewPanel .invoice-register-row {
  transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

#invoiceViewPanel .invoice-register-row:hover td {
  background: rgba(79, 107, 255, 0.045);
}

#invoiceViewPanel .invoice-register-row.is-reconciled td:first-child {
  box-shadow: inset 3px 0 0 rgba(34, 197, 94, 0.72);
}

#invoiceViewPanel .invoice-register-table tr:last-child td {
  border-bottom: 0;
}

#invoiceViewPanel .invoice-total-hover {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.18rem 0.34rem;
  border-radius: 8px;
  color: #1f2f58;
  font-weight: 800;
  cursor: zoom-in;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

#invoiceViewPanel .invoice-total-hover:hover,
#invoiceViewPanel .invoice-total-hover:focus-visible {
  outline: none;
  background: rgba(79, 107, 255, 0.1);
  color: #2441c2;
  box-shadow: 0 0 0 3px rgba(79, 107, 255, 0.12);
}

.invoice-verified-text {
  display: inline-flex;
  align-items: center;
  min-height: 1.72rem;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.invoice-verified-text.is-verified {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.invoice-verified-text.is-unverified {
  background: rgba(148, 163, 184, 0.14);
  color: #64748b;
}

.invoice-register-hover-preview {
  position: fixed;
  z-index: 2200;
  width: min(360px, calc(100vw - 24px));
  padding: 0.85rem;
  border: 1px solid rgba(121, 142, 202, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.18);
  color: #1f2f58;
  pointer-events: none;
}

.invoice-hover-preview-head,
.invoice-hover-preview-customer,
.invoice-hover-preview-totals {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.invoice-hover-preview-head {
  margin-bottom: 0.75rem;
}

.invoice-hover-preview-head strong,
.invoice-hover-preview-customer strong {
  display: block;
  color: #172033;
}

.invoice-hover-preview-head span,
.invoice-hover-preview-customer span {
  display: block;
  color: #64748b;
  font-size: 0.82rem;
}

.invoice-hover-preview-customer {
  padding: 0.65rem 0;
  border-top: 1px solid rgba(121, 142, 202, 0.16);
  border-bottom: 1px solid rgba(121, 142, 202, 0.16);
}

.invoice-hover-preview-items {
  display: grid;
  gap: 0.42rem;
  margin: 0.72rem 0;
  padding: 0;
  list-style: none;
}

.invoice-hover-preview-items li,
.invoice-hover-preview-totals span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.invoice-hover-preview-items li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
}

.invoice-hover-preview-items li strong {
  white-space: nowrap;
}

.invoice-hover-preview-totals {
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(121, 142, 202, 0.16);
  font-size: 0.88rem;
}

#invoiceViewPanel .invoice-register-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(121, 142, 202, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
  color: #607092;
  font-weight: 700;
}

#invoiceViewPanel .invoice-register-pagination-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

#invoiceViewPanel .invoice-register-page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: #607092;
  font-size: 0.85rem;
  font-weight: 800;
}

#invoiceViewPanel #invoiceRowsPerPage {
  width: 4.6rem;
  min-height: 38px;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(121, 142, 202, 0.26);
  border-radius: 10px;
  background: #ffffff;
  color: #1f2f58;
  font-weight: 800;
  text-align: center;
  box-shadow: none;
}

#invoiceViewPanel .invoice-row-action-menu .action-menu-summary {
  justify-content: center;
  width: 46px;
  min-width: 46px;
  min-height: 42px;
  gap: 0.4rem;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(121, 142, 202, 0.16);
  background: #f1f5f9;
  color: #1f2f58;
  font-weight: 800;
  transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

#invoiceViewPanel .invoice-row-action-menu .action-menu-summary:hover {
  transform: translateY(-1px);
  background: #e8eef8;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

#invoiceViewPanel .invoice-row-action-menu .action-menu-summary > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

#invoiceViewPanel .invoice-row-action-menu .action-menu-list {
  min-width: 220px;
  border-radius: 14px;
}

.invoice-number-verify-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-width: 0;
  padding: 0.24rem 0.32rem 0.24rem 0;
  border-radius: 999px;
}

.invoice-register-row.is-reconciled .invoice-number-verify-cell {
  padding-left: 0.58rem;
  padding-right: 0.52rem;
  background: rgba(34, 197, 94, 0.08);
}

.invoice-number-verify-cell strong {
  line-height: 1.15;
}

.invoice-reconciled-tick {
  display: inline-grid;
  place-items: center;
  width: 1.18rem;
  height: 1.18rem;
  border: 1px solid rgba(34, 197, 94, 0.32);
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.72rem;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(34, 197, 94, 0.12);
}

@media (max-width: 1180px) {
  #invoiceViewPanel .invoice-register-toolbar {
    grid-template-columns: minmax(280px, 1fr) repeat(2, minmax(150px, 1fr));
  }

  #invoiceViewPanel .invoice-register-search {
    grid-column: 1 / -1;
  }

  #invoiceViewPanel .compact-filter:first-of-type,
  #invoiceViewPanel #invoiceClearDateFilterBtn {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  #invoiceViewPanel .invoice-register-actions,
  #invoiceViewPanel .invoice-register-toolbar,
  #invoiceViewPanel .invoice-register-pagination {
    grid-template-columns: 1fr;
  }

  #invoiceViewPanel .invoice-register-actions {
    align-items: stretch;
  }

  #invoiceViewPanel .invoice-register-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  #invoiceViewPanel .invoice-register-pagination-controls {
    justify-content: stretch;
  }

  #invoiceViewPanel .invoice-register-page-size {
    justify-content: space-between;
  }

  #invoiceViewPanel .invoice-register-actions .primary-btn,
  #invoiceViewPanel #invoiceClearDateFilterBtn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 1280px) {
  .invoice-home-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .invoice-home-activity-card {
    max-height: none;
  }

  .invoice-home-activity-card .serial-home-activity-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .invoice-home-customer-table-wrap {
    max-height: none;
  }

  .invoice-home-print-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .invoice-home-stat-grid,
  .invoice-home-print-settings-grid,
  .invoice-template-preset-grid,
  .invoice-home-settings-heading,
  .invoice-home-signature-row {
    grid-template-columns: 1fr;
  }

  .invoice-home-settings-heading {
    display: grid;
  }

  .invoice-settings-page-heading .invoice-create-heading-bar {
    flex-wrap: wrap;
  }

  .invoice-home-settings-heading-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .invoice-home-signature-row .action-row {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
}
