:root {
  --bg: #f4f4f4;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #696963;
  --border: #d9d9d3;
  --border-strong: #b8b8af;
  --accent: #073d8e;
  --accent-dark: #052f70;
  --soft-blue: #eef4ff;
  --panel: #f6f1fa;
  --danger: #9b2f2f;
  --paid: #276749;
  --partial: #8a5a00;
  --cancelled: #77716b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
}

button:hover {
  border-color: var(--border-strong);
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.primary:hover {
  background: var(--accent-dark);
}

.danger {
  color: var(--danger);
}

.link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 210px 1fr;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 0 10px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 76px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  margin: 0 -10px 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-weight: 700;
}

.brand strong,
.brand span {
  display: block;
  color: var(--text);
}

.brand div span {
  color: var(--muted);
  font-size: 12px;
}

.mobile-menu-toggle {
  display: none;
}

nav {
  display: grid;
  gap: 7px;
}

nav button {
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: #53637c;
  display: block;
  align-items: center;
  min-height: 42px;
  font-weight: 500;
}

nav button.active {
  background: #e9eef7;
  border-color: #e9eef7;
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset -3px 0 0 var(--accent);
}

.user-strip {
  margin: auto -10px 0;
  border-top: 1px solid var(--border);
  padding: 12px 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-strip > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0fb;
  color: var(--accent);
  font-weight: 700;
}

.user-strip strong,
.user-strip small {
  display: block;
}

.main {
  min-width: 0;
  padding: 0;
}

.topbar {
  height: 56px;
  overflow: visible;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 4;
}

.topbar h1 {
  font-size: 22px;
  margin: 0;
}

.content {
  padding: 28px 32px 72px;
  overflow-x: auto;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
  margin-bottom: 5px;
  font-weight: 650;
}

h2 {
  font-size: 17px;
  margin-bottom: 0;
}

h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: 8px;
}

.page-head p,
.empty,
small {
  color: var(--muted);
}

.head-actions,
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.metrics,
.detail-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.detail-hero h1 {
  font-size: 34px;
  margin: 0 0 6px;
}

.detail-hero p {
  color: var(--muted);
  margin: 0;
  font-size: 16px;
}

.detail-hero .status {
  font-size: 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
}

.detail-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.detail-cards div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 10px 28px rgba(25, 35, 50, 0.08);
}

.detail-cards span,
.detail-cards small {
  display: block;
  color: var(--muted);
}

.detail-cards strong {
  display: block;
  font-size: 25px;
  margin: 12px 0 8px;
}

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

.detail-workspace.single-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.detail-line-items,
.payment-overview,
.payment-history-section {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.detail-line-items,
.payment-overview {
  margin-top: 0;
}

.detail-line-items .section-title,
.payment-overview .section-title,
.payment-history-section .section-title {
  min-height: 72px;
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.detail-line-items .section-title h2,
.payment-overview .section-title h2,
.payment-history-section .section-title h2 {
  margin: 0;
  font-size: 18px;
}

.detail-line-items .section-title p,
.payment-overview .section-title p,
.payment-history-section .section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-line-items .section-title > span,
.payment-history-section .section-title > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.detail-line-list {
  width: 100%;
}

.detail-line-head,
.detail-line-row {
  display: grid;
  align-items: center;
}

.detail-invoice-grid {
  grid-template-columns: 46px minmax(220px, 1fr) 92px 94px 140px 150px;
}

.detail-goods-grid {
  grid-template-columns: 46px minmax(260px, 1fr) 120px 140px;
}

.detail-line-head {
  min-height: 38px;
  padding: 0 18px;
  background: #f7f9fc;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-line-head span:not(:nth-child(2)) {
  text-align: right;
}

.detail-line-head span:first-child {
  text-align: left;
}

.detail-line-row {
  min-height: 76px;
  padding: 12px 18px;
  border-top: 1px solid #e7ebf0;
}

.detail-line-head + .detail-line-row {
  border-top: 0;
}

.detail-line-row:hover {
  background: #fafcff;
}

.line-number {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 700;
}

.line-description,
.line-value {
  min-width: 0;
}

.line-description strong,
.line-description small,
.line-value strong,
.line-value small {
  display: block;
}

.line-description strong,
.line-description small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-description strong {
  color: #101828;
  font-size: 14px;
}

.line-description small,
.line-value small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.line-value {
  text-align: right;
}

.line-value small {
  display: none;
}

.line-value strong {
  color: #344054;
  font-size: 13px;
}

.line-value.total strong {
  color: #101828;
  font-weight: 750;
}

.payment-chart-wrap {
  display: grid;
  justify-items: center;
  gap: 24px;
  padding: 26px 22px 24px;
}

.payment-donut {
  position: relative;
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#16845b 0 var(--paid-angle), #e46868 var(--paid-angle) 360deg);
}

.payment-donut::after {
  content: "";
  position: absolute;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #edf0f4;
}

.payment-donut > div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.payment-donut strong,
.payment-donut span {
  display: block;
}

.payment-donut strong {
  color: #101828;
  font-size: 28px;
  line-height: 1;
}

.payment-donut span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.payment-legend {
  display: grid;
  width: 100%;
  gap: 10px;
}

.payment-legend > div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid #e7ebf0;
  border-radius: 8px;
}

.payment-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.paid-dot {
  background: #16845b;
}

.unpaid-dot {
  background: #e46868;
}

.payment-legend span,
.payment-legend span small {
  color: #475467;
}

.payment-legend span small {
  margin-left: 4px;
}

.payment-legend strong {
  color: #101828;
  font-size: 12px;
}

.payment-history-section {
  margin-top: 20px;
}

.payment-history-list {
  display: grid;
}

.payment-history-row {
  display: grid;
  grid-template-columns: 42px 125px 150px minmax(130px, 0.8fr) minmax(180px, 1fr) 160px;
  gap: 16px;
  align-items: center;
  min-height: 74px;
  padding: 12px 20px;
  border-top: 1px solid #e7ebf0;
}

.payment-history-row:first-child {
  border-top: 0;
}

.payment-history-row > div {
  min-width: 0;
}

.payment-history-row small,
.payment-history-row strong {
  display: block;
}

.payment-history-row small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.payment-history-row strong {
  overflow: hidden;
  color: #344054;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-sequence {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 700;
}

.payment-amount {
  text-align: right;
}

.payment-amount strong {
  color: #101828;
  font-size: 14px;
  font-weight: 750;
}

.payment-empty {
  min-height: 120px;
  padding: 42px 20px;
  text-align: center;
}

.hero-strip {
  background: #233146;
  color: #fff;
  border-radius: 14px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 16px 32px rgba(25, 35, 50, 0.18);
  margin-bottom: 28px;
}

.hero-strip h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.hero-strip p {
  color: #d4d9e3;
  margin: 0;
}

.invoiso-metrics {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 16px;
  border: 0;
}

.invoiso-metrics div,
.list-stats div {
  background: #fff;
  border: 0;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 10px 28px rgba(25, 35, 50, 0.08);
}

.invoiso-metrics span {
  font-weight: 650;
  color: #5b5b5b;
}

.list-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.list-stats span {
  color: var(--muted);
  font-size: 12px;
}

.list-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.alert-list {
  margin: 24px 0;
}

.danger-line {
  border-left: 4px solid #ee3232;
  padding-left: 12px;
}

.danger-line h2 small,
.count {
  border: 1px solid #ff9c9c;
  background: #fff2f2;
  color: #ee3232;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  margin-left: 8px;
}

.alert-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  background: #fff7ff;
  border: 1px solid #ffb4b4;
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 10px;
  box-shadow: 0 2px 5px rgba(120, 50, 50, 0.15);
}

.metrics div,
.detail-strip div {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
}

.metrics div:last-child,
.detail-strip div:last-child {
  border-right: 0;
}

.metrics span,
.detail-strip span,
.totals span,
.print-totals span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metrics strong,
.detail-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
  font-weight: 650;
}

.section {
  margin-top: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dashboard-documents .section-title {
  margin-bottom: 14px;
}

.dashboard-documents .section-title h2 {
  margin: 0;
}

.dashboard-documents .section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-documents .section-title > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.document-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 220px) minmax(190px, 220px);
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(16, 24, 40, 0.04);
}

.document-filter-bar label {
  gap: 5px;
}

.document-filter-bar label > span {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
}

.document-filter-bar input,
.document-filter-bar select {
  min-height: 42px;
}

.dashboard-documents-table[hidden],
.dashboard-documents-table tr[hidden],
#dashboardDocumentEmpty[hidden] {
  display: none;
}

.document-filter-empty {
  min-height: 150px;
  padding: 58px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.empty.compact {
  min-height: 58px;
  padding: 18px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 9px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: #3b3b37;
  font-size: 13px;
  font-weight: 500;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(25, 35, 50, 0.04);
}

th,
td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
  background: #f8f9fc;
}

.invoice-bar {
  background: var(--accent);
  color: #fff;
  margin: -28px -32px 12px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
}

.invoice-bar h1 {
  margin: 0;
  font-size: 23px;
}

.builder-grid {
  display: grid;
  grid-template-columns: 320px minmax(760px, 1fr);
  gap: 18px;
  align-items: start;
}

.picker-column {
  display: grid;
  gap: 22px;
  align-content: start;
}

.panel {
  background: var(--panel);
  border: 1px solid #e3deeb;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 3px 7px rgba(30, 20, 50, 0.16);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-title h2,
.panel h2 {
  font-size: 17px;
  margin: 0 0 10px;
}

.panel-title h2 {
  margin: 0;
}

.pick-list {
  display: grid;
  gap: 8px;
  height: 270px;
  overflow-y: auto;
  margin-top: 12px;
  padding-right: 6px;
  scrollbar-color: #b6b1c7 #f2edf8;
  scrollbar-width: thin;
}

.pick-list button {
  display: block;
  text-align: left;
  border: 1px solid #e7e2ef;
  background: #fff;
  padding: 12px;
  border-radius: 10px;
}

.pick-list button.selected,
.pick-list button:hover {
  background: #e4e3f1;
  border-color: #c8c2d8;
}

.pick-list strong,
.pick-list small {
  display: block;
}

.builder-main {
  display: grid;
  gap: 14px;
}

.builder-top-panels {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.two {
  grid-template-columns: repeat(2, minmax(140px, 1fr));
}

.customer-snapshot {
  min-height: 114px;
  display: grid;
  gap: 4px;
  color: #4b4b55;
}

.saved,
.count {
  background: #fff;
  border: 1px solid #dfdbe8;
  color: #7a7384;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.invoice-items-panel {
  min-height: 300px;
}

.invoice-item-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}

.invoice-item-card {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 36px minmax(420px, 1fr) 150px 80px;
  gap: 12px;
  align-items: center;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.invoice-item-card.active,
.invoice-item-card:focus-within {
  background: #f8fbff;
  border-color: #84adff;
  border-left-color: #155eef;
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.12), 0 6px 18px rgba(16, 24, 40, 0.08);
}

.invoice-item-card.active .line-no,
.invoice-item-card:focus-within .line-no {
  background: #155eef;
  color: #fff;
}

.line-no {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e5f4ff;
  color: #1688d1;
  font-weight: 800;
}

.line-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.line-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.bottom-composer {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 220px 220px;
  gap: 12px;
  align-items: start;
}

.additional-toggle {
  grid-column: 1 / -1;
  background: #f1fbfb;
  border-color: #b8e4e4;
  color: #007070;
  text-align: left;
}

.bottom-composer .wide {
  grid-column: 1 / 2;
}

.bottom-composer .totals {
  grid-column: 1 / -1;
}

.bottom-composer .additional-toggle {
  grid-column: 1 / -1;
}

.payment-selects,
.tax-box {
  display: grid;
  gap: 8px;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch-row input {
  width: auto;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--panel);
  border: 1px solid #ded8e9;
  border-radius: 12px;
  padding: 12px;
  margin: 18px 0 0 338px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  box-shadow: 0 -2px 8px rgba(35, 30, 45, 0.14);
}

.sticky-actions .primary {
  min-width: 260px;
}

.wide-modal {
  width: min(1000px, 96vw);
}

td small {
  display: block;
  margin-top: 3px;
}

.num {
  text-align: right;
  white-space: nowrap;
}

td:first-child,
td:nth-child(3) {
  white-space: nowrap;
}

td.actions,
.actions {
  min-width: 340px;
  flex-wrap: nowrap;
}

.empty {
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.status {
  font-weight: 600;
  white-space: nowrap;
}

.status.paid {
  color: var(--paid);
}

.status.partially-paid {
  color: var(--partial);
}

.status.cancelled {
  color: var(--cancelled);
}

.status.unpaid {
  color: var(--danger);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 16px;
  align-items: start;
}

.wide {
  grid-column: span 2;
}

.line-table td:first-child {
  width: 34px;
}

.line-table select {
  margin-bottom: 6px;
}

.invoice-options {
  display: grid;
  grid-template-columns: 160px 140px 1fr 260px;
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}

.totals,
.print-totals {
  border-top: 1px solid var(--border);
}

.totals div,
.print-totals div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.totals strong,
.print-totals strong {
  font-weight: 650;
  text-align: right;
}

.totals .grand,
.print-totals div:last-child {
  font-size: 16px;
}

.errors {
  border-left: 3px solid var(--danger);
  padding: 10px 12px;
  background: #fff5f5;
  color: var(--danger);
  margin-bottom: 16px;
}

.field-error {
  margin-top: -4px;
  padding: 9px 11px;
  border-left: 3px solid var(--danger);
  border-radius: 4px;
  background: #fff4f2;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.field-error[hidden] {
  display: none;
}

.error-modal {
  border-top: 4px solid var(--danger);
}

.error-modal ul {
  margin: 0;
  padding-left: 20px;
  color: var(--danger);
}

fieldset {
  border: 0;
  border-top: 1px solid var(--border);
  padding: 16px 0 22px;
  margin: 0;
}

legend {
  font-size: 16px;
  font-weight: 650;
  padding-right: 12px;
}

.invoice-preview {
  background: #fff;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 26px rgba(25, 35, 50, 0.08);
}

.invoice-top {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(420px, 1.4fr);
  gap: 28px;
  align-items: start;
  border-bottom: 1px solid #8c8c8c;
  padding-bottom: 14px;
}

.invoice-logo {
  font-size: 20px;
  color: #111;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.invoice-brandline {
  align-items: flex-start;
}

.invoice-logo-img,
.invoice-logo-fallback {
  width: 128px;
  height: 96px;
  border: 0;
  border-radius: 0;
  padding: 0;
  object-fit: contain;
}

.invoice-logo-fallback {
  display: grid;
  place-items: center;
  background: #227f99;
  color: #fff;
  font-size: 60px;
  font-weight: 800;
}

.invoice-company p,
.invoice-contact-strip span,
.invoice-contact-strip small {
  color: #111;
  font-size: 10px;
  line-height: 1.18;
}

.invoice-contact-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.invoice-contact-strip > div {
  min-height: 76px;
  border-left: 1px solid #8c8c8c;
  padding-left: 22px;
}

.invoice-contact-strip b {
  display: block;
  color: #f58220;
  font-size: 11px;
  margin-bottom: 12px;
}

.invoice-contact-strip a {
  color: #155eef;
  font-size: 14px;
  font-weight: 600;
}

.invoice-middle {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 42px;
  align-items: start;
  padding: 18px 0 18px;
}

.invoice-summary-zone h2 {
  text-align: center;
  font-size: 36px;
  color: #000;
  margin: 0 0 28px;
  font-weight: 800;
}

.summary-band {
  background: #f58220;
  color: #000;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 24px 18px 18px;
}

.summary-band span,
.summary-band strong {
  display: block;
  color: #000;
}

.summary-band span {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
}

.bill-to {
  padding: 0;
}

.bill-to h3 {
  color: #f58220;
  margin-bottom: 12px;
}

.bill-to p {
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 18px;
}

.print-table {
  margin-top: 0;
  min-width: 0;
  box-shadow: none;
  table-layout: fixed;
  border: 0;
  border-radius: 0;
}

.print-table thead th {
  background: #fff;
  color: #000;
  font-size: 16px;
  text-transform: none;
  border-bottom: 0;
}

.print-table tbody {
  background: #d9d9d9;
}

.print-table tbody td {
  background: #d9d9d9;
  color: #000;
  padding: 3px 10px;
  font-size: 12px;
  border-bottom: 0;
  line-height: 1.2;
}

.print-table tbody tr:nth-child(even) td {
  background: #d2d2d2;
}

.print-table tbody::after {
  content: "";
  display: table-row;
  height: 170px;
  background: #d9d9d9;
}

.invoice-preview table {
  min-width: 0;
}

.invoice-bottom {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 380px;
  gap: 28px 48px;
  margin-top: 26px;
  align-items: start;
}

.payment-method {
  width: 420px;
  max-width: 100%;
  background: #9f9f9f;
  color: #000;
  padding: 10px 18px;
}

.bank-details {
  grid-column: 1;
  margin-top: 80px;
  font-size: 10px;
}

.bank-details h3 {
  color: #000;
  text-transform: none;
}

.bank-details p {
  color: #000;
}

.print-totals {
  grid-column: 2;
  grid-row: 1 / span 2;
  border-top: 0;
}

.print-totals div {
  border-bottom: 0;
  padding: 8px 0;
  color: #000;
}

.print-totals .total-due {
  background: #f58220;
  padding: 14px 18px;
  margin-top: 8px;
  font-size: 17px;
  align-items: center;
}

.print-totals .total-due span {
  color: #000;
  font-size: 17px;
  font-weight: 800;
}

.signature {
  grid-column: 2;
  display: grid;
  gap: 34px;
  justify-items: center;
  color: #000;
  padding-top: 60px;
}

.signature strong {
  font-size: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.32);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
}

.modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
}

.template-option {
  display: grid;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.template-option.selected,
.template-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(7, 61, 142, 0.12);
}

.template-option input {
  width: auto;
}

.template-card {
  height: 150px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcff;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.template-card em {
  justify-self: end;
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
}

.template-card i {
  display: block;
  height: 10px;
  background: #e7ecf6;
  border-radius: 4px;
}

.template-card strong {
  justify-self: end;
}

.template-card.classic {
  border-top: 6px solid var(--accent);
}

.template-card.minimal {
  border-color: transparent;
  background: #fff;
}

/* Final layout polish for a cleaner SaaS default */
.topbar {
  display: none;
}

.content {
  overflow-x: hidden;
}

.page-head {
  margin-bottom: 16px;
}

.brand-mark.logo-image,
.invoice-logo-img {
  object-fit: contain;
  background: #fff;
}

.brand-mark.logo-image {
  padding: 3px;
}

.invoice-brandline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.invoice-logo-img {
  width: 58px;
  height: 58px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  flex: 0 0 auto;
}

.logo-uploader {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px);
  gap: 14px;
  align-items: end;
}

.logo-preview {
  min-height: 82px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.logo-preview img,
.logo-preview > span {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: contain;
  display: grid;
  place-items: center;
  background: var(--soft-blue);
  color: var(--accent);
  font-weight: 800;
}

.sync-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.sync-panel p {
  margin: 0;
  color: var(--muted);
}

.slim {
  padding: 7px 12px;
  min-width: 72px;
}

/* Clean SaaS visual pass */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #101828;
  --muted: #667085;
  --border: #e4e7ec;
  --border-strong: #cbd5e1;
  --accent: #155eef;
  --accent-dark: #004eeb;
  --soft-blue: #eff4ff;
  --panel: #ffffff;
  --danger: #b42318;
  --paid: #027a48;
  --partial: #b54708;
  --cancelled: #667085;
}

body {
  background:
    radial-gradient(circle at top right, rgba(21, 94, 239, 0.08), transparent 32rem),
    var(--bg);
  color: var(--text);
}

#app {
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 28px rgba(16, 24, 40, 0.04);
}

@media (min-width: 861px) {
  #app {
    display: block;
    padding-left: 232px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    width: 232px;
    height: 100vh;
    overflow-y: auto;
  }

  .main {
    width: 100%;
    min-height: 100vh;
  }
}

.brand {
  height: 72px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(21, 94, 239, 0.22);
}

.brand strong {
  font-size: 15px;
}

nav {
  gap: 5px;
  padding-top: 8px;
}

nav button {
  min-height: 40px;
  border-radius: 10px;
  padding: 10px 12px;
  color: #475467;
}

nav button:hover {
  background: #f2f4f7;
  border-color: transparent;
}

nav button.active {
  background: var(--soft-blue);
  border-color: #d1e0ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.user-strip {
  border-top: 1px solid var(--border);
}

.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  font-size: 20px;
  font-weight: 700;
}

.content {
  padding: 28px 36px 76px;
}

button {
  border-radius: 10px;
  padding: 9px 13px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

button:hover {
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.primary {
  box-shadow: 0 8px 18px rgba(21, 94, 239, 0.2);
}

.primary:hover {
  transform: translateY(-1px);
}

input,
select,
textarea {
  border-color: #d0d5dd;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 42px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  resize: none;
  overflow: hidden;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(21, 94, 239, 0.12);
}

.hero-strip {
  background: linear-gradient(135deg, #101828, #1d2939);
  border-radius: 20px;
  box-shadow: 0 18px 36px rgba(16, 24, 40, 0.18);
}

.invoiso-metrics {
  gap: 18px;
}

.invoiso-metrics div,
.list-stats div,
.detail-cards div,
.panel,
.invoice-preview,
.modal,
table {
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.07);
}

.invoiso-metrics div,
.list-stats div {
  padding: 20px 22px;
}

.invoiso-metrics strong,
.detail-cards strong {
  color: #101828;
}

.page-head h1,
.invoice-bar h1,
.detail-hero h1 {
  letter-spacing: 0;
}

.toolbar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.05);
}

table {
  min-width: 0;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: #f9fafb;
  color: #475467;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  background: #fff;
}

tbody tr:hover td {
  background: #f9fbff;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f2f4f7;
  font-size: 12px;
}

.status.unpaid {
  background: #fef3f2;
}

.status.partially-paid {
  background: #fffaeb;
}

.status.paid {
  background: #ecfdf3;
}

.status.proforma {
  background: #eef4ff;
  color: #1849a9;
}

.invoice-bar {
  margin: 0 0 18px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #155eef, #0b4bcc);
  box-shadow: 0 16px 34px rgba(21, 94, 239, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.invoice-bar strong {
  white-space: normal;
}

.builder-grid {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 20px;
}

.builder-top-panels {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.two {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.panel {
  padding: 16px;
}

.panel-title h2,
.panel h2 {
  color: #101828;
}

.pick-list button,
.invoice-item-card {
  border-color: var(--border);
  border-radius: 12px;
}

.pick-list {
  height: 220px;
  gap: 7px;
  align-content: start;
  grid-auto-rows: max-content;
}

.pick-list button {
  padding: 9px 10px;
  min-height: 54px;
}

.pick-list strong {
  font-size: 14px;
  line-height: 1.25;
}

.pick-list small {
  font-size: 12px;
}

.pick-list button:hover,
.pick-list button.selected {
  background: var(--soft-blue);
  border-color: #b2ccff;
}

.invoice-item-card {
  grid-template-columns: 38px minmax(0, 1fr) minmax(120px, auto) auto;
  border-left: 4px solid #b2ccff;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}

.invoice-item-card + .invoice-item-card {
  margin-top: 4px;
}

.invoice-item-card > strong {
  white-space: nowrap;
}

.line-meta {
  grid-template-columns: repeat(3, minmax(110px, 1fr));
}

.bottom-composer {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 220px) minmax(180px, 220px);
}

.line-no {
  border-radius: 12px;
  background: var(--soft-blue);
  color: var(--accent);
}

.additional-toggle {
  background: #f8fbff;
  border-color: #b2ccff;
  color: var(--accent);
}

.sticky-actions {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 -10px 30px rgba(16, 24, 40, 0.1);
}

.detail-hero {
  grid-template-columns: minmax(260px, 1fr) auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.07);
}

.detail-hero .status {
  justify-self: start;
}

.detail-hero .head-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.detail-hero h1 {
  font-size: 30px;
}

.detail-cards {
  gap: 18px;
}

.invoice-preview {
  border-radius: 18px;
  width: min(920px, 100%);
}

.wide-modal {
  width: min(1120px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 18px;
}

.wide-modal .invoice-preview {
  max-width: 100%;
  margin: 0;
  padding: 30px;
  overflow: hidden;
}

td.actions,
.actions {
  min-width: 0;
  flex-wrap: wrap;
}

.template-option {
  border-radius: 16px;
}

.template-card {
  border-radius: 14px;
}

.gleva-template {
  max-width: 1040px;
  width: min(1040px, 100%);
  border-radius: 0;
  color: #000;
}

.gleva-template .invoice-top {
  grid-template-columns: minmax(310px, 0.9fr) minmax(430px, 1.2fr);
}

.gleva-template .invoice-brandline {
  align-items: flex-start;
}

.gleva-template .invoice-logo-img,
.gleva-template .invoice-logo-fallback {
  width: 132px;
  height: 98px;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.gleva-template .invoice-middle {
  grid-template-columns: 330px minmax(420px, 1fr);
}

.gleva-template .print-table th:nth-child(1) {
  width: 32px;
}

.gleva-template .print-table th:nth-child(2) {
  width: 48%;
}

.gleva-template .print-table th:nth-child(3) {
  width: 10%;
}

.gleva-template .print-table th:nth-child(4) {
  width: 12%;
}

.gleva-template .print-table th:nth-child(5),
.gleva-template .print-table th:nth-child(6) {
  width: 15%;
}

.gleva-template .invoice-bottom {
  grid-template-columns: minmax(320px, 1fr) 380px;
}

/* Pixel-style invoice sheet matching the provided Proforma reference */
.invoice-preview.gleva-template {
  position: relative;
  width: 1120px;
  max-width: 1120px;
  min-height: 1500px;
  padding: 0;
  background: #fff;
  border: 1px solid #bfbfbf;
  border-radius: 0;
  box-shadow: 0 14px 36px rgba(16, 24, 40, 0.08);
  font-family: Arial, Helvetica, sans-serif;
  transform-origin: top left;
}

.gleva-template .invoice-top,
.gleva-template .invoice-middle,
.gleva-template .invoice-bottom {
  display: block;
}

.gleva-template .invoice-top {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1120px;
  height: 176px;
  border: 0;
  padding: 0;
}

.gleva-template .invoice-company {
  position: absolute;
  left: 0;
  top: 0;
  width: 445px;
  height: 170px;
}

.gleva-template .invoice-brandline {
  display: flex;
  gap: 18px;
  margin: 0;
}

.gleva-template .invoice-logo-img,
.gleva-template .invoice-logo-fallback {
  width: 152px;
  height: 118px;
  margin: 0 0 0 0;
}

.gleva-template .invoice-logo-fallback {
  border: 6px solid #247f99;
  border-radius: 50%;
  background: #fff;
  color: #247f99;
  font-size: 82px;
  line-height: 1;
}

.gleva-template .invoice-logo {
  margin-top: 34px;
  margin-bottom: 6px;
  color: #000;
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
}

.gleva-template .invoice-company p {
  margin: 0;
  color: #000;
  font-size: 10.5px;
  line-height: 1.15;
}

.gleva-template .invoice-contact-strip {
  position: absolute;
  left: 448px;
  top: 62px;
  width: 536px;
  height: 90px;
  display: grid;
  grid-template-columns: 150px 165px 190px;
  gap: 0;
  border-bottom: 1px solid #808080;
}

.gleva-template .invoice-contact-strip > div {
  min-height: 72px;
  border-left: 1px solid #8b8b8b;
  padding-left: 26px;
}

.gleva-template .invoice-contact-strip b {
  color: #f58220;
  font-size: 12px;
  margin-bottom: 14px;
}

.gleva-template .invoice-contact-strip span,
.gleva-template .invoice-contact-strip small {
  display: block;
  color: #000;
  font-size: 9px;
  line-height: 1.15;
}

.gleva-template .invoice-contact-strip a {
  display: block;
  margin-top: 14px;
  color: #0000ee;
  font-size: 15px;
  font-weight: 400;
}

.gleva-template .invoice-middle {
  position: absolute;
  left: 0;
  top: 178px;
  width: 1120px;
  height: 292px;
  padding: 0;
}

.gleva-template .bill-to {
  position: absolute;
  left: 70px;
  top: 0;
  width: 370px;
  color: #000;
}

.gleva-template .bill-to h3 {
  color: #f58220;
  font-size: 14px;
  margin: 0 0 16px;
  font-weight: 700;
}

.gleva-template .bill-to p {
  color: #000;
  font-size: 13px;
  line-height: 1.2;
  margin: 0 0 26px;
}

.gleva-template .bill-to strong {
  color: #000;
  font-size: 13px;
}

.gleva-template .invoice-summary-zone {
  position: absolute;
  left: 448px;
  top: 0;
  width: 544px;
}

.gleva-template .invoice-summary-zone h2 {
  margin: 0 0 56px;
  text-align: center;
  color: #000;
  font-size: 42px;
  line-height: 1;
  font-weight: 800;
}

.gleva-template .summary-band {
  height: 82px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 28px 16px 12px;
  gap: 0;
  background: #f58220;
  color: #000;
}

.gleva-template .summary-band span {
  margin: 0 0 10px;
  color: #000;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
}

.gleva-template .summary-band strong {
  color: #000;
  font-size: 13px;
  line-height: 1;
  font-weight: 400;
  text-align: center;
}

.gleva-template .print-table {
  position: absolute;
  left: 0;
  top: 478px;
  width: 992px;
  border: 0;
  border-radius: 0;
  border-collapse: collapse;
  box-shadow: none;
  table-layout: fixed;
}

.gleva-template .print-table thead th {
  height: 26px;
  padding: 0 12px 4px;
  color: #000;
  background: #fff;
  border: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
  text-transform: none;
  vertical-align: bottom;
}

.gleva-template .print-table thead th:nth-child(1) {
  width: 36px;
  text-align: left;
  padding-left: 12px;
}

.gleva-template .print-table thead th:nth-child(2) {
  width: 468px;
  text-align: left;
}

.gleva-template .print-table thead th:nth-child(3) {
  width: 170px;
}

.gleva-template .print-table thead th:nth-child(4) {
  width: 150px;
}

.gleva-template .print-table thead th:nth-child(5) {
  width: 168px;
}

.gleva-template .print-table tbody {
  display: block;
  min-height: 336px;
  background: #d9d9d9;
}

.gleva-template .print-table thead,
.gleva-template .print-table tbody tr {
  display: table;
  width: 992px;
  table-layout: fixed;
}

.gleva-template .print-table tbody td {
  padding: 3px 12px 1px;
  color: #000;
  background: #d9d9d9;
  border: 0;
  font-size: 13px;
  line-height: 1.05;
  vertical-align: top;
}

.gleva-template .print-table tbody tr:nth-child(even) td {
  background: #d9d9d9;
}

.gleva-template .print-table tbody::after {
  display: none;
}

.gleva-template .invoice-bottom {
  position: absolute;
  left: 0;
  top: 814px;
  width: 1120px;
  height: 600px;
  margin: 0;
}

.gleva-template .payment-method {
  position: absolute;
  left: 31px;
  top: 0;
  width: 438px;
  height: 29px;
  padding: 8px 62px;
  background: #9b9b9b;
  color: #000;
  font-size: 12px;
  line-height: 1;
}

.gleva-template .payment-method strong {
  font-weight: 800;
}

.gleva-template .bank-details {
  position: absolute;
  left: 36px;
  top: 168px;
  width: 330px;
  margin: 0;
  color: #000;
  font-size: 10px;
  line-height: 1.1;
}

.gleva-template .bank-details h3 {
  color: #000;
  font-size: 11px;
  margin-bottom: 22px;
  font-weight: 800;
  text-transform: none;
}

.gleva-template .bank-details p {
  color: #000;
  font-size: 10px;
  line-height: 1.12;
}

.gleva-template .print-totals {
  position: absolute;
  left: 620px;
  top: 38px;
  width: 370px;
  color: #000;
}

.gleva-template .print-totals div {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 16px;
  padding: 8px 0;
  color: #000;
  border: 0;
}

.gleva-template .print-totals span {
  color: #000;
  font-size: 14px;
  text-align: left;
}

.gleva-template .print-totals strong {
  color: #000;
  font-size: 13px;
  text-align: right;
  font-weight: 400;
}

.gleva-template .print-totals .total-due {
  display: grid;
  grid-template-columns: 1fr 150px;
  align-items: center;
  width: 370px;
  height: 41px;
  margin-top: 8px;
  padding: 0 48px 0 82px;
  background: #f58220;
}

.gleva-template .print-totals .total-due span {
  color: #000;
  font-size: 19px;
  font-weight: 800;
  white-space: nowrap;
}

.gleva-template .print-totals .total-due strong {
  color: #000;
  font-size: 13px;
  font-weight: 800;
}

.gleva-template .signature {
  position: absolute;
  left: 730px;
  top: 356px;
  display: grid;
  gap: 42px;
  justify-items: center;
  color: #000;
  padding: 0;
  font-size: 12px;
}

.gleva-template .signature strong {
  color: #000;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 860px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: block;
    padding: 0;
    background: rgba(255, 255, 255, 0.98);
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
    overflow: visible;
  }

  .brand {
    height: 58px;
    margin: 0;
    padding: 8px 14px;
    justify-content: flex-start;
  }

  .mobile-menu-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    min-height: 42px;
    margin-left: auto;
    padding: 10px;
    place-content: center;
    gap: 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
  }

  .mobile-menu-toggle:hover,
  .mobile-menu-toggle:focus-visible {
    background: #f2f4f7;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: #344054;
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .mobile-menu-toggle.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .sidebar nav {
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    z-index: 21;
    display: none;
    max-height: calc(100vh - 58px);
    overflow-y: auto;
    padding: 10px 12px 14px;
    background: #fff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 32px rgba(16, 24, 40, 0.14);
  }

  .sidebar nav.open {
    display: grid;
    gap: 4px;
  }

  .sidebar nav button {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    text-align: left;
    white-space: normal;
  }

  .user-strip {
    display: none;
  }

  .content {
    padding: 20px 16px 36px;
    overflow-x: hidden;
  }

  .page-head,
  .invoice-top,
  .invoice-bottom,
  .invoice-options,
  .builder-grid,
  .builder-top-panels,
  .bottom-composer,
  .detail-hero,
  .detail-cards {
    grid-template-columns: 1fr;
  }

  .page-head {
    display: grid;
  }

  .invoice-bar {
    grid-template-columns: 1fr;
    gap: 5px;
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 14px;
  }

  .invoice-bar strong {
    justify-self: start;
    font-size: 12px;
  }

  .builder-grid {
    gap: 14px;
    min-width: 0;
  }

  .builder-grid > .picker-column,
  .builder-grid > .builder-main,
  .builder-main > .builder-top-panels {
    display: contents;
  }

  .document-details-panel {
    order: 1;
  }

  .customer-picker-panel {
    order: 2;
  }

  .customer-details-panel {
    order: 3;
  }

  .item-picker-panel {
    order: 4;
  }

  .invoice-items-panel {
    order: 5;
  }

  .bottom-composer {
    order: 6;
  }

  .builder-grid .panel {
    width: 100%;
    min-width: 0;
  }

  .metrics,
  .detail-strip,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: span 1;
  }

  .invoice-preview {
    padding: 22px;
  }

  .gleva-template .invoice-top,
  .gleva-template .invoice-middle,
  .gleva-template .invoice-bottom {
    grid-template-columns: 1fr;
  }

  .gleva-template .invoice-contact-strip,
  .gleva-template .summary-band {
    grid-template-columns: 1fr;
  }

  .gleva-template .bank-details,
  .gleva-template .print-totals,
  .gleva-template .signature {
    grid-column: auto;
    grid-row: auto;
    margin-top: 0;
  }

  .sticky-actions {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .invoice-item-card {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .invoice-item-card > strong,
  .invoice-item-card > button {
    grid-column: 2;
    justify-self: start;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  body {
    background: #fff;
  }

  #app {
    display: block;
  }

  .sidebar,
  .no-print,
  .topbar,
  .sticky-actions,
  .modal-backdrop {
    display: none !important;
  }

  .main {
    padding: 0;
  }

  .content {
    padding: 0;
    overflow: visible;
  }

  .invoice-preview {
    display: block !important;
    max-width: none;
    border: 0;
    box-shadow: none;
    padding: 14mm;
  }

  button {
    display: none;
  }

  table {
    break-inside: auto;
  }

  tr {
    break-inside: avoid;
  }
}

@media screen {
  .invoice-preview.gleva-template {
    zoom: 0.88;
  }

  .wide-modal .invoice-preview.gleva-template {
    zoom: 0.86;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  .invoice-preview.gleva-template {
    width: 1120px;
    min-height: 1500px;
    padding: 0;
    border: 0;
    zoom: 0.75;
  }
}

.invoice-preview:not(.gleva-template) {
  max-width: 920px;
  width: min(920px, 100%);
  min-height: auto;
  padding: 42px;
  border-radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.invoice-preview:not(.gleva-template) .invoice-top {
  display: grid;
  position: static;
  width: auto;
  height: auto;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  border-bottom: 2px solid #20201e;
  padding-bottom: 22px;
}

.invoice-preview:not(.gleva-template) .invoice-brandline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.invoice-preview:not(.gleva-template) .invoice-logo-img {
  width: 58px;
  height: 58px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
}

.invoice-preview:not(.gleva-template) .invoice-logo {
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
  text-transform: none;
  margin: 0;
}

.invoice-preview:not(.gleva-template) .invoice-title {
  text-align: right;
}

.invoice-preview:not(.gleva-template) .invoice-title h2 {
  font-size: 28px;
  margin-bottom: 18px;
}

.invoice-preview:not(.gleva-template) .bill-to {
  position: static;
  width: auto;
  padding: 22px 0 12px;
}

.invoice-preview:not(.gleva-template) .bill-to h3 {
  color: var(--muted);
}

.invoice-preview:not(.gleva-template) .print-table {
  position: static;
  width: 100%;
  margin-top: 8px;
}

.invoice-preview:not(.gleva-template) .print-table thead,
.invoice-preview:not(.gleva-template) .print-table tbody,
.invoice-preview:not(.gleva-template) .print-table tbody tr {
  display: revert;
  width: auto;
}

.invoice-preview:not(.gleva-template) .print-table th {
  background: #f9fafb;
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.invoice-preview:not(.gleva-template) .print-table td {
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  font-size: 14px;
  line-height: 1.35;
  border-bottom: 1px solid var(--border);
}

.invoice-preview:not(.gleva-template) .invoice-bottom {
  display: grid;
  position: static;
  width: auto;
  height: auto;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  margin-top: 24px;
}

/* Modern single invoice style */
.invoice-preview:not(.gleva-template) {
  --invoice-accent: #1e3a8a;
  --invoice-soft: #eef4ff;
  --invoice-border: #c7d2fe;
  --invoice-ink: #111827;
  width: min(980px, 100%);
  max-width: 980px;
  padding: 44px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.11);
  color: var(--invoice-ink);
}

.invoice-preview:not(.gleva-template)::before {
  content: "";
  display: block;
  height: 10px;
  margin: -44px -44px 34px;
  background: var(--invoice-accent);
}

.invoice-preview:not(.gleva-template) .invoice-top {
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 40px;
  align-items: start;
  border-bottom: 2px solid var(--invoice-ink);
  padding-bottom: 22px;
}

.invoice-preview:not(.gleva-template) .invoice-logo {
  color: var(--invoice-ink);
  font-size: 28px;
  line-height: 1.05;
  font-weight: 800;
}

.invoice-preview:not(.gleva-template) .invoice-logo-img {
  width: 70px;
  height: 70px;
  border-color: var(--invoice-border);
  background: var(--invoice-soft);
}

.invoice-preview:not(.gleva-template) .invoice-title {
  background: var(--invoice-soft);
  border: 1px solid var(--invoice-border);
  border-radius: 8px;
  padding: 20px;
}

.invoice-preview:not(.gleva-template) .invoice-title h2 {
  color: var(--invoice-accent);
  font-size: 34px;
  margin-bottom: 20px;
  letter-spacing: 0;
}

.invoice-preview:not(.gleva-template) dl {
  gap: 9px 16px;
}

.invoice-preview:not(.gleva-template) dt {
  color: #64748b;
}

.invoice-preview:not(.gleva-template) dd {
  color: var(--invoice-ink);
}

.invoice-preview:not(.gleva-template) .bill-to {
  width: min(430px, 100%);
  margin: 28px 0 30px;
  padding: 22px 24px;
  background: var(--invoice-soft);
  border: 1px solid var(--invoice-border);
  border-radius: 8px;
}

.invoice-preview:not(.gleva-template) .bill-to h3 {
  margin-bottom: 12px;
  color: var(--invoice-accent);
}

.invoice-preview:not(.gleva-template) .print-table {
  border: 1px solid var(--invoice-border);
  border-radius: 8px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

.invoice-preview:not(.gleva-template) .print-table th {
  background: var(--invoice-accent);
  color: #fff;
  border-bottom: 0;
  padding: 12px 14px;
}

.invoice-preview:not(.gleva-template) .print-table td {
  padding: 14px;
  border-color: #dbe4f0;
}

.invoice-preview:not(.gleva-template) .print-table tbody tr:nth-child(even) td {
  background: #f8fbff;
}

.invoice-preview:not(.gleva-template) .invoice-bottom {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 44px;
  margin-top: 34px;
  border-top: 2px solid var(--invoice-ink);
  padding-top: 24px;
}

.invoice-preview:not(.gleva-template) .print-totals {
  border: 1px solid var(--invoice-border);
  border-radius: 8px;
  overflow: hidden;
}

.invoice-preview:not(.gleva-template) .print-totals div {
  padding: 12px 16px;
  border-bottom: 1px solid #dbe4f0;
}

.invoice-preview:not(.gleva-template) .print-totals div:last-child {
  background: var(--invoice-soft);
  border-bottom: 0;
  color: var(--invoice-accent);
}

@media (max-width: 1500px) {
  .detail-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .payment-chart-wrap {
    grid-template-columns: auto minmax(280px, 460px);
    justify-content: center;
    align-items: center;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
    background: #f6f8fc;
  }

  #app {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: block;
    padding: 0;
    background: rgba(255, 255, 255, 0.96);
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
  }

  .brand {
    height: 58px;
    margin: 0;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    justify-content: flex-start;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex: 0 0 auto;
  }

  .brand strong {
    font-size: 15px;
    line-height: 1.1;
  }

  .brand div span {
    font-size: 12px;
  }

  .sidebar nav {
    display: none;
    gap: 4px;
    overflow-y: auto;
    padding: 10px 12px 14px;
  }

  .sidebar nav.open {
    display: grid;
  }

  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar nav button {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    white-space: normal;
    font-size: 14px;
  }

  .sidebar nav button.active {
    box-shadow: inset 3px 0 0 var(--accent);
    border-color: #b2ccff;
    background: #eff4ff;
  }

  .user-strip {
    display: none;
  }

  .main,
  .content {
    width: 100%;
    min-width: 0;
  }

  .content {
    padding: 16px 14px 96px;
    overflow-x: hidden;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  textarea {
    line-height: 1.4;
  }

  .builder-grid button,
  .modal button {
    min-height: 42px;
  }

  .hero-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0 0 16px;
    padding: 18px;
    border-radius: 16px;
  }

  .hero-strip h2 {
    font-size: 24px;
    line-height: 1.08;
  }

  .hero-strip p,
  .hero-strip strong {
    font-size: 13px;
    line-height: 1.35;
  }

  .metrics,
  .invoiso-metrics,
  .detail-cards,
  .list-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    border: 0;
    margin-bottom: 18px;
  }

  .invoiso-metrics div,
  .list-stats div,
  .detail-cards div {
    min-height: 92px;
    padding: 16px;
    border-radius: 14px;
  }

  .invoiso-metrics strong,
  .detail-cards strong {
    font-size: 20px;
    overflow-wrap: anywhere;
  }

  .page-head {
    display: grid;
    gap: 12px;
  }

  .head-actions,
  .actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    min-width: 0;
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
  }

  th,
  td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .section-title h2 {
    font-size: 18px;
  }

  .detail-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .detail-line-items,
  .payment-overview,
  .payment-history-section {
    border-radius: 12px;
  }

  .detail-line-items .section-title,
  .payment-overview .section-title,
  .payment-history-section .section-title {
    min-height: 64px;
    padding: 14px;
  }

  .detail-line-items .section-title > span,
  .payment-history-section .section-title > span {
    text-align: right;
  }

  .detail-line-head {
    display: none;
  }

  .detail-line-row.detail-invoice-grid,
  .detail-line-row.detail-goods-grid {
    grid-template-columns: 28px repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-height: 0;
    padding: 16px 14px;
  }

  .detail-line-row + .detail-line-row {
    border-top: 1px solid #dfe4ea;
  }

  .detail-line-row .line-number {
    grid-column: 1;
    grid-row: 1 / span 3;
    padding-top: 2px;
  }

  .detail-line-row .line-description {
    grid-column: 2 / -1;
  }

  .line-description strong,
  .line-description small {
    white-space: normal;
  }

  .detail-line-row .line-value {
    min-width: 0;
    padding-top: 9px;
    border-top: 1px solid #edf0f4;
    text-align: left;
  }

  .detail-line-row .line-value small {
    display: block;
  }

  .detail-line-row .line-value strong {
    overflow-wrap: anywhere;
  }

  .payment-chart-wrap {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px 16px;
  }

  .payment-donut {
    width: 156px;
    height: 156px;
  }

  .payment-donut::after {
    width: 112px;
    height: 112px;
  }

  .payment-history-row {
    grid-template-columns: 28px repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    min-height: 0;
    padding: 16px 14px;
  }

  .payment-history-row .payment-sequence {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  .payment-history-row > div:nth-child(2),
  .payment-history-row > div:nth-child(4) {
    grid-column: 2;
  }

  .payment-history-row > div:nth-child(3),
  .payment-history-row > div:nth-child(5) {
    grid-column: 3;
  }

  .payment-history-row .payment-amount {
    grid-column: 2 / -1;
    padding-top: 10px;
    border-top: 1px solid #edf0f4;
    text-align: left;
  }

  .document-filter-bar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .dashboard-documents .section-title {
    align-items: flex-end;
    gap: 12px;
  }

  .dashboard-documents .section-title > span {
    flex: 0 0 auto;
  }

  .builder-grid,
  .builder-top-panels,
  .bottom-composer,
  .line-meta,
  .form-grid,
  .detail-hero,
  .invoice-preview:not(.gleva-template) .invoice-top,
  .invoice-preview:not(.gleva-template) .invoice-bottom {
    grid-template-columns: 1fr;
  }

  .picker-column {
    gap: 14px;
  }

  .panel {
    border-radius: 14px;
    padding: 14px;
  }

  .pick-list {
    height: min(210px, 30vh);
  }

  .invoice-bar {
    padding: 16px;
    border-radius: 16px;
  }

  .invoice-bar h1 {
    font-size: 22px;
  }

  .invoice-item-list {
    max-height: none;
  }

  .invoice-item-card {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .invoice-item-card > strong,
  .invoice-item-card > button {
    grid-column: 2;
    justify-self: start;
  }

  .sticky-actions {
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    border-radius: 16px 16px 0 0;
    padding: 10px;
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sticky-actions button,
  .sticky-actions .primary {
    width: 100%;
    min-width: 0;
  }

  .detail-hero {
    padding: 16px;
    border-radius: 16px;
  }

  .detail-hero h1 {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .wide-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 12px;
    border-radius: 16px;
  }

  .wide-modal .invoice-preview,
  .invoice-preview:not(.gleva-template) {
    width: 100%;
    max-width: 100%;
    padding: 22px;
    border-radius: 14px;
    overflow-x: auto;
  }

  .invoice-preview:not(.gleva-template)::before {
    margin: -22px -22px 22px;
  }

  .invoice-preview:not(.gleva-template) .invoice-title {
    text-align: left;
  }

  .invoice-preview:not(.gleva-template) .invoice-title h2 {
    font-size: 28px;
  }

  .invoice-preview:not(.gleva-template) .bill-to {
    width: 100%;
    padding: 16px;
  }

  .invoice-preview:not(.gleva-template) .print-table {
    display: table;
    table-layout: auto;
    width: max-content;
    min-width: 680px;
  }

  .invoice-preview:not(.gleva-template) .print-table th,
  .invoice-preview:not(.gleva-template) .print-table td {
    min-width: 96px;
  }

  .invoice-preview:not(.gleva-template) .print-table th:nth-child(2),
  .invoice-preview:not(.gleva-template) .print-table td:nth-child(2) {
    min-width: 220px;
  }

  .sync-panel,
  .logo-uploader {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .content {
    padding-inline: 10px;
  }

  .metrics,
  .invoiso-metrics,
  .detail-cards,
  .list-stats {
    grid-template-columns: 1fr;
  }

  .hero-strip h2 {
    font-size: 22px;
  }

  .sticky-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Exact Gleva document sheet */
.invoice-preview.gleva-template {
  position: relative;
  width: 1120px;
  max-width: none;
  min-height: 1584px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #b7b7b7;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  transform-origin: top left;
  zoom: 0.72;
}

.gleva-template .invoice-top {
  position: absolute;
  inset: 0;
  display: block;
  width: 1120px;
  height: 174px;
  padding: 0;
  border: 0;
}

.gleva-template .invoice-company {
  position: absolute;
  top: 28px;
  left: 48px;
  width: 392px;
  height: 145px;
}

.gleva-template .invoice-brandline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 0;
}

.gleva-template .invoice-logo-img {
  flex: 0 0 auto;
  width: 160px;
  height: 132px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.gleva-template .invoice-brandline > div {
  margin: 34px 0 0 -17px;
}

.gleva-template .invoice-logo {
  margin: 0 0 7px;
  color: #000;
  font-size: 19px;
  line-height: 1;
  font-weight: 400;
  text-transform: uppercase;
  white-space: nowrap;
}

.gleva-template .invoice-company p {
  margin: 0;
  color: #000;
  font-size: 10.5px;
  line-height: 1.55;
}

.gleva-template .invoice-contact-strip {
  position: absolute;
  top: 82px;
  left: 490px;
  display: grid;
  width: 580px;
  height: 86px;
  grid-template-columns: 188px 166px 226px;
  border-bottom: 1px solid #8b8b8b;
}

.gleva-template .invoice-contact-strip > div {
  position: relative;
  min-height: 82px;
  padding: 0 18px;
  border-left: 1px solid #8b8b8b;
}

.gleva-template .invoice-contact-strip > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.gleva-template .invoice-contact-strip b {
  display: block;
  height: 28px;
  margin: 0;
  color: #f58220;
  font-size: 22px;
  line-height: 1;
}

.gleva-template .invoice-contact-strip span,
.gleva-template .invoice-contact-strip small {
  display: block;
  color: #000;
  font-size: 9px;
  line-height: 1.35;
}

.gleva-template .invoice-contact-strip a {
  display: block;
  margin-top: 9px;
  color: #0000ee;
  font-size: 15px;
  line-height: 1;
  font-weight: 600;
  text-decoration: underline;
}

.gleva-template .invoice-middle {
  position: absolute;
  inset: 0;
  display: block;
  width: 1120px;
  height: 430px;
  padding: 0;
}

.gleva-template .bill-to {
  position: absolute;
  top: 180px;
  left: 97px;
  width: 350px;
  padding: 0;
  color: #000;
}

.gleva-template .customer-doc-icon {
  position: relative;
  width: 18px;
  height: 24px;
  margin: 0 0 12px;
  border: 2px solid #f58220;
  border-radius: 1px;
  color: #f58220;
}

.gleva-template .customer-doc-icon::before,
.gleva-template .customer-doc-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  width: 9px;
  height: 2px;
  background: #f58220;
  box-shadow: 0 5px 0 #f58220;
}

.gleva-template .customer-doc-icon::before {
  top: 5px;
}

.gleva-template .customer-doc-icon::after {
  right: -5px;
  bottom: -5px;
  left: auto;
  width: 9px;
  height: 9px;
  border: 2px solid #f58220;
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
}

.gleva-template .bill-to p {
  margin: 0 0 14px;
  color: #000;
  font-size: 13px;
  line-height: 1.35;
}

.gleva-template .bill-to strong {
  color: #000;
  font-size: 13px;
  font-weight: 700;
}

.gleva-template .bill-to .customer-email {
  color: #0000ee;
  font-size: 15px;
  text-decoration: underline;
}

.gleva-template .company-tin {
  position: absolute;
  top: 398px;
  left: 170px;
  color: #000;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
}

.gleva-template .invoice-summary-zone {
  position: absolute;
  top: 190px;
  left: 488px;
  width: 582px;
}

.gleva-template .invoice-summary-zone h2 {
  margin: 0;
  color: #000;
  font-size: 43px;
  line-height: 1;
  font-weight: 800;
  text-align: left;
}

.gleva-template.delivery-template .invoice-summary-zone h2 {
  font-size: 38px;
}

.gleva-template .summary-icons {
  position: absolute;
  top: 82px;
  left: 0;
  display: grid;
  width: 430px;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
}

.gleva-template .summary-icons span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid #8c8c8c;
  border-radius: 50%;
  background: #fff;
  color: #f58220;
  font-size: 19px;
  font-weight: 700;
}

.gleva-template .summary-band {
  position: absolute;
  top: 136px;
  left: 0;
  display: grid;
  width: 582px;
  height: 90px;
  grid-template-columns: repeat(3, 1fr);
  padding: 29px 18px 12px;
  background: #f58220;
  color: #000;
}

.gleva-template .summary-band > div {
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
}

.gleva-template .summary-band span {
  color: #000;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
}

.gleva-template .summary-band strong {
  color: #000;
  font-size: 13px;
  line-height: 1;
  font-weight: 400;
  text-align: center;
}

.gleva-template .print-table {
  position: absolute;
  top: 439px;
  left: 52px;
  display: table;
  width: 1018px;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  border-radius: 0;
  box-shadow: none;
  table-layout: fixed;
}

.gleva-template .print-table thead,
.gleva-template .print-table tbody tr {
  display: table;
  width: 1018px;
  table-layout: fixed;
}

.gleva-template .print-table thead th {
  height: 26px;
  padding: 0 10px 5px;
  border: 0;
  background: #fff;
  color: #000;
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
  text-align: left;
  text-transform: none;
  vertical-align: bottom;
}

.gleva-template .print-table th:nth-child(1),
.gleva-template .print-table td:nth-child(1) {
  width: 36px;
}

.gleva-template .print-table th:nth-child(2),
.gleva-template .print-table td:nth-child(2) {
  width: 453px;
}

.gleva-template .print-table th:nth-child(3),
.gleva-template .print-table td:nth-child(3) {
  width: 78px;
}

.gleva-template .print-table th:nth-child(4),
.gleva-template .print-table td:nth-child(4) {
  width: 160px;
}

.gleva-template .print-table th:nth-child(5),
.gleva-template .print-table td:nth-child(5) {
  width: 130px;
}

.gleva-template .print-table th:nth-child(6),
.gleva-template .print-table td:nth-child(6) {
  width: 161px;
}

.gleva-template .print-table th.num,
.gleva-template .print-table td.num {
  text-align: right;
}

.gleva-template .print-table tbody {
  display: block;
  width: 1018px;
  min-height: 424px;
  background: #d6d6d6;
}

.gleva-template .print-table tbody td,
.gleva-template .print-table tbody tr:nth-child(even) td {
  padding: 3px 10px 1px;
  border: 0;
  background: #d6d6d6;
  color: #000;
  font-size: 13px;
  line-height: 1.05;
  font-weight: 400;
  vertical-align: top;
}

.gleva-template .document-reference {
  position: absolute;
  top: 635px;
  left: 168px;
  color: #000;
  font-size: 12px;
  font-weight: 700;
}

.gleva-template .invoice-bottom {
  position: absolute;
  top: 887px;
  left: 0;
  display: block;
  width: 1120px;
  height: 500px;
  margin: 0;
}

.gleva-template .payment-method {
  position: absolute;
  top: 0;
  left: 83px;
  width: 470px;
  height: 31px;
  padding: 8px 47px;
  background: #9b9b9b;
  color: #000;
  font-size: 12px;
  line-height: 1;
}

.gleva-template .bank-details {
  position: absolute;
  top: 150px;
  left: 85px;
  width: 330px;
  margin: 0;
  color: #000;
}

.gleva-template .bank-details h3 {
  margin: 0 0 21px;
  color: #000;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}

.gleva-template .bank-details p {
  margin: 0;
  color: #000;
  font-size: 10px;
  line-height: 1.2;
}

.gleva-template .print-totals {
  position: absolute;
  top: 39px;
  left: 694px;
  width: 376px;
  color: #000;
}

.gleva-template .print-totals > div {
  display: grid;
  width: 376px;
  grid-template-columns: 1fr 170px;
  gap: 18px;
  padding: 7px 0;
  border: 0;
}

.gleva-template .print-totals span {
  color: #000;
  font-size: 14px;
  text-align: left;
}

.gleva-template .print-totals strong {
  color: #000;
  font-size: 13px;
  font-weight: 400;
  text-align: right;
}

.gleva-template .print-totals .total-due {
  width: 376px;
  height: 45px;
  margin-top: 4px;
  padding: 11px 46px;
  background: #f58220;
}

.gleva-template .print-totals .total-due span {
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
}

.gleva-template .print-totals .total-due strong {
  font-weight: 800;
}

.gleva-template .signature {
  position: absolute;
  top: 316px;
  left: 801px;
  display: grid;
  gap: 43px;
  justify-items: center;
  color: #000;
  font-size: 12px;
}

.gleva-template .signature strong {
  color: #000;
  font-size: 14px;
  font-weight: 800;
}

.gleva-template .invoice-footer {
  position: absolute;
  top: 1388px;
  left: 0;
  width: 1120px;
  height: 170px;
  color: #000;
}

.gleva-template .thanks {
  font-size: 16px;
  text-align: center;
}

.gleva-template .footer-rule {
  position: absolute;
  top: 22px;
  left: 50px;
  width: 910px;
  height: 4px;
  background: #c75f13;
}

.gleva-template .footer-terms,
.gleva-template .footer-contact {
  position: absolute;
  top: 38px;
  color: #000;
  font-size: 9px;
}

.gleva-template .footer-terms {
  left: 53px;
  width: 520px;
}

.gleva-template .footer-contact {
  left: 698px;
  width: 250px;
}

.gleva-template .footer-terms strong,
.gleva-template .footer-contact strong {
  color: #000;
  font-size: 9px;
}

.gleva-template .footer-terms p,
.gleva-template .footer-contact p {
  margin: 40px 0 0;
  color: #000;
  font-size: 9px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .invoice-preview.gleva-template,
  .wide-modal .invoice-preview.gleva-template {
    width: 1120px;
    max-width: none;
    min-height: 1584px;
    padding: 0;
    overflow: hidden;
    zoom: 0.62;
  }

  .gleva-template .invoice-contact-strip,
  .gleva-template .summary-band,
  .gleva-template .summary-icons {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .invoice-preview.gleva-template,
  .wide-modal .invoice-preview.gleva-template {
    zoom: 0.31;
  }
}

@media (max-width: 420px) {
  .invoice-preview.gleva-template,
  .wide-modal .invoice-preview.gleva-template {
    zoom: 0.285;
  }
}

@media print {
  .invoice-preview.gleva-template {
    width: 1120px;
    min-height: 1584px;
    padding: 0;
    border: 0;
    box-shadow: none;
    zoom: 0.707;
  }
}
