:root {
  --navy: #2f354f;
  --navy-2: #20263c;
  --paper: #fffdf8;
  --cream: #f6f2ea;
  --line: #e8dfd2;
  --muted: #777b8d;
  --sage: #788c6d;
  --caramel: #b17942;
  color: var(--navy-2);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

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

button {
  cursor: pointer;
}

strong,
h1,
h2,
h3,
h4 {
  font-weight: 600;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.82), transparent 24%),
    linear-gradient(135deg, #fbf8f1 0%, #f0e7d8 52%, #f7f3ed 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding: 28px;
  border-right: 1px solid rgba(47, 53, 79, 0.11);
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(18px);
}

.brand,
.profile-row,
.top-actions,
.client-box,
.activity-item,
.detail-header,
.section-heading,
.search-box {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: 174px;
  max-width: 100%;
  height: auto;
}

.brand-icon {
  display: none;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.avatar,
.icon-btn {
  display: grid;
  place-items: center;
}

.profile-row {
  gap: 12px;
  margin-bottom: 18px;
}

.profile-row strong {
  display: block;
  font-size: 15px;
}

.profile-row span,
.client-box span,
.activity-item span,
.invoice-row span,
.table-row span,
.balance-card span,
.mini-stats span,
.topbar p,
.invoice-detail p,
label,
.metric-card span,
.stock-strip span {
  color: var(--muted);
  font-size: 12px;
}

.menu-list {
  display: grid;
  gap: 10px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  font-weight: 500;
}

.menu-item.active {
  color: #ffffff;
  background: var(--navy);
}

.workspace {
  padding: 28px;
  overflow: hidden;
}

.topbar {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow,
.topbar h1 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

.top-actions {
  margin-left: auto;
  gap: 12px;
}

.account-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 8px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.82);
}

.account-box span {
  color: var(--navy);
  font-size: 13px;
  font-weight: 500;
}

.sidebar-toggle {
  display: none;
  flex: 0 0 auto;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 18px;
  color: var(--navy-2);
  background: rgba(255, 255, 255, 0.72);
}

.icon-btn.ghost {
  background: transparent;
}

.icon-btn.danger {
  color: #a4462a;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 18px;
  color: #ffffff;
  font-weight: 500;
  background: var(--navy);
}

.avatar.small {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.logo-avatar {
  object-fit: contain;
  padding: 7px;
  background: #ffffff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.hero-panel,
.activity-panel,
.metrics-panel,
.form-panel,
.invoice-detail,
.transaction-page,
.transaction-list,
.product-panel {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 24px 70px rgba(47, 53, 79, 0.09);
}

.hero-panel {
  display: grid;
  align-content: start;
  padding: 24px;
  color: #ffffff;
  background: var(--navy);
}

.hero-panel .profile-row span,
.hero-panel .balance-card span {
  color: rgba(255, 255, 255, 0.7);
}

.hero-panel .mini-stats span {
  color: #4f5876;
}

.balance-card {
  position: relative;
  min-height: 126px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.balance-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.bars {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: end;
  gap: 7px;
  height: 96px;
}

.bars i {
  width: 6px;
  border-radius: 99px;
  background: #d2b27e;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.mini-stats div {
  padding: 14px;
  border-radius: 18px;
  color: var(--navy);
  background: #ffffff;
}

.mini-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
}

.primary-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  color: #ffffff;
  font-weight: 500;
  background: var(--navy);
}

.primary-btn.compact {
  width: auto;
}

.secondary-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--navy);
  font-weight: 500;
  background: #ffffff;
}

.secondary-btn.compact {
  min-height: 38px;
}

.danger-fill {
  background: #8f3d2d;
}

.activity-panel,
.transaction-list,
.product-panel,
.metrics-panel,
.form-panel,
.transaction-page,
.invoice-detail {
  padding: 22px;
}

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

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

.page-head h2 {
  margin: 4px 0 0;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.row-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.transaction-form-page {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: none;
}

.form-wide {
  grid-column: 1 / -1;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2,
.invoice-detail h2,
.invoice-detail h3 {
  margin: 0;
}

.section-heading h2,
.invoice-detail h2 {
  font-size: 17px;
}

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

.metric-card {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--navy);
  font-size: 24px;
  line-height: 1.08;
}

.stock-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  color: #ffffff;
  background: var(--navy);
}

.stock-strip span {
  color: rgba(255, 255, 255, 0.7);
}

.stock-strip strong {
  text-align: right;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.tabs button {
  min-width: 76px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
}

.tabs button.active {
  color: #ffffff;
  background: var(--navy);
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-item,
.invoice-row {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: #faf7f0;
  text-align: left;
}

.activity-item {
  gap: 12px;
  padding: 12px;
}

.activity-item .amount {
  margin-left: auto;
  text-align: right;
}

.paid,
.success {
  color: var(--sage);
}

.pending {
  color: var(--caramel);
}

.client-box {
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: #ffffff;
}

.client-box strong {
  display: block;
}

.transaction-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(300px, 420px) minmax(260px, 1fr);
  gap: 24px;
  align-items: start;
}

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

.detail-actions {
  max-width: 820px;
  margin: 20px auto 0;
  padding: 0 4px 4px;
}

.detail-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto 14px;
  padding: 12px 14px;
  border: 1px solid rgba(47, 53, 79, 0.1);
  border-radius: 18px;
  background: #fbf8f1;
}

.detail-status-bar span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-status-bar strong {
  display: block;
  margin-top: 3px;
}

.payment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px 0 6px;
  border: 1px solid rgba(177, 121, 66, 0.28);
  border-radius: 999px;
  color: var(--caramel);
  background: #ffffff;
  font-weight: 600;
}

.payment-toggle span {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--caramel);
}

.payment-toggle.paid {
  border-color: rgba(120, 140, 109, 0.35);
  color: var(--sage);
}

.payment-toggle.paid span {
  background: var(--sage);
}

.pdf-preview-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pdf-preview-frame {
  display: block;
  width: 100%;
  height: min(78vh, 920px);
  min-height: 620px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 48px rgba(47, 53, 79, 0.14);
}

.pdf-preview-loading {
  display: grid;
  place-items: center;
  min-height: 620px;
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
  box-shadow: 0 16px 48px rgba(47, 53, 79, 0.14);
}

.invoice-preview {
  display: grid;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--navy-2);
  background: #ffffff;
  box-shadow: 0 16px 48px rgba(47, 53, 79, 0.14);
}

.preview-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.preview-top img {
  width: 190px;
  max-width: 52%;
  height: auto;
}

.preview-top h3 {
  margin: 10px 0 0;
  color: var(--navy);
  font-size: 22px;
  text-align: right;
}

.preview-rule {
  height: 6px;
  border-radius: 999px;
  background: var(--navy);
}

.preview-info-grid,
.preview-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.preview-box {
  min-height: 128px;
  padding: 18px;
  border-radius: 0;
  background: #f5efe4;
}

.preview-box h4 {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: 12px;
}

.preview-box p,
.preview-box strong,
.preview-box dt,
.preview-box dd,
.preview-total span,
.preview-total strong {
  font-size: 12px;
}

.preview-box p {
  margin: 10px 0 0;
}

.preview-note {
  padding-top: 8px;
  border-top: 1px solid rgba(47, 53, 79, 0.12);
}

.preview-box dl,
.preview-total {
  display: grid;
  gap: 12px;
  margin: 0;
}

.preview-box dl div,
.preview-total div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.preview-box dt {
  color: var(--muted);
}

.preview-box dd {
  margin: 0;
  font-weight: 600;
}

.preview-table {
  overflow-x: auto;
  border: 1px solid #b7c4cf;
}

.preview-table-head,
.preview-table-row {
  display: grid;
  grid-template-columns: 44px 72px minmax(170px, 1fr) 112px 78px 110px;
  min-width: 620px;
}

.preview-table-head {
  color: #ffffff;
  background: var(--navy);
}

.preview-table-head span,
.preview-table-row span,
.preview-table-row strong {
  padding: 12px;
  border-right: 1px solid #b7c4cf;
  font-size: 12px;
}

.preview-table-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.transaction-item-row {
  grid-template-columns: minmax(180px, 1fr) 96px 42px;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.preview-table-row span:last-child,
.preview-table-head span:last-child {
  border-right: 0;
}

.payment-box {
  background: #fbf8f1;
}

.preview-total {
  align-content: end;
  padding: 10px 0;
}

.preview-grand {
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid #c8d4dc;
  font-weight: 600;
}

.preview-grand.dark {
  margin-top: 0;
  padding: 16px;
  border: 0;
  color: #ffffff;
  background: var(--navy);
}

.pdf-status {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(120, 140, 109, 0.36);
  border-radius: 18px;
  color: var(--sage);
  background: rgba(120, 140, 109, 0.1);
  font-size: 13px;
  font-weight: 500;
}

form,
.invoice-lines,
.product-table {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--navy-2);
  background: #ffffff;
  outline: none;
}

textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #c4a271;
  box-shadow: 0 0 0 4px rgba(177, 121, 66, 0.13);
}

.invoice-detail {
  background: #ffffff;
}

.detail-header {
  justify-content: center;
  position: relative;
  margin-bottom: 22px;
}

.detail-header .icon-btn {
  position: absolute;
  left: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.invoice-detail h3 {
  margin-top: 16px;
  font-size: 26px;
}

.invoice-lines {
  margin: 20px 0;
  padding: 18px;
  border-radius: 18px;
  background: var(--paper);
}

.edit-title {
  display: grid;
  gap: 10px;
}

.edit-invoice-form,
.product-page {
  display: grid;
  gap: 14px;
}

.compact-heading {
  margin-bottom: 10px;
}

.edit-items {
  display: grid;
  gap: 10px;
}

.payment-fields {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.payment-fields .section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.payment-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.edit-item-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 82px 110px 42px;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.invoice-lines h4 {
  margin: 4px 0;
  color: var(--navy-2);
  font-size: 12px;
}

.line-item,
.total-row,
.grand-total,
.invoice-row,
.table-head,
.table-row {
  display: grid;
  align-items: center;
  gap: 12px;
}

.line-item,
.total-row,
.grand-total {
  grid-template-columns: 1fr auto;
}

.line-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.accent {
  color: var(--caramel);
}

.grand-total {
  margin: 6px -8px -8px;
  padding: 14px 10px;
  border-radius: 18px;
  background: #f5ecdf;
}

.invoice-row {
  grid-template-columns: 1fr auto;
  margin-bottom: 10px;
  padding: 14px;
}

.invoice-row.active {
  outline: 2px solid var(--navy);
  background: #f5f0e8;
}

.product-panel {
  max-width: 1120px;
}

.product-panel.subpage .search-box,
.product-panel.subpage .table-head,
.product-panel.subpage #addProductBtn {
  display: none;
}

.search-box {
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.search-box input {
  border: 0;
  box-shadow: none;
}

.table-head,
.table-row {
  grid-template-columns: minmax(150px, 1.4fr) minmax(110px, 1fr) 0.8fr 0.55fr 0.75fr 1fr;
}

.table-head {
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.table-row {
  min-height: 62px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #faf7f0;
}

.product-row {
  width: 100%;
  border: 0;
  text-align: left;
}

.product-row.active {
  outline: 2px solid var(--navy);
}

.product-detail-card {
  display: block;
  padding: 16px;
  border-radius: 18px;
  background: var(--paper);
}

.product-detail-card img {
  display: none;
  width: 0;
  height: 0;
  object-fit: contain;
}

.product-detail-card h3,
.product-detail-card p {
  margin: 0;
}

.product-detail-card h3 {
  margin: 4px 0;
  font-size: 22px;
}

.product-metrics {
  margin: 4px 0;
}

.product-log-panel {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 16px;
  border-radius: 18px;
  background: var(--paper);
}

.product-log-panel .section-heading {
  margin-bottom: 0;
}

.product-log-panel .section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.product-log-list {
  display: grid;
  gap: 10px;
}

.product-log-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  border: 0;
  border-radius: 18px;
  color: var(--navy-2);
  background: #ffffff;
  text-align: left;
}

.product-log-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.product-log-row > div:last-child {
  text-align: right;
}

.empty-state {
  padding: 22px;
  border-radius: 18px;
  color: var(--muted);
  background: #faf7f0;
}

.bottom-nav {
  display: none;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 76px 1fr;
  }

  .app-shell:has(.sidebar:hover) {
    grid-template-columns: 76px 1fr;
  }

  .sidebar {
    position: sticky;
    z-index: 2;
    width: 76px;
    padding: 18px 12px;
    overflow: hidden;
    transform: none;
    transition: width 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
  }

  .sidebar:hover {
    width: 232px;
    z-index: 30;
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 24px 0 60px rgba(47, 53, 79, 0.16);
  }

  .brand {
    justify-content: center;
  }

  .brand-logo {
    display: none;
  }

  .brand-icon {
    display: block;
  }

  .sidebar:hover .brand {
    justify-content: flex-start;
  }

  .sidebar:hover .brand-logo {
    display: block;
    width: 150px;
  }

  .sidebar:hover .brand-icon {
    display: none;
  }

  .menu-item {
    justify-content: center;
    gap: 0;
    padding: 0;
    font-size: 0;
  }

  .menu-item span {
    font-size: 17px;
  }

  .sidebar:hover .menu-item {
    justify-content: flex-start;
    gap: 10px;
    padding: 0 14px;
    font-size: 14px;
  }

  .sidebar-toggle {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: minmax(240px, 0.95fr) minmax(300px, 1.05fr);
    gap: 20px;
    align-items: stretch;
  }

  .hero-panel {
    min-height: 372px;
  }

  .hero-panel .balance-card {
    min-height: 172px;
  }

  .activity-panel {
    grid-column: 1 / -1;
  }

  .transaction-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 84px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-open .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .sidebar-toggle {
    display: none;
  }

  .workspace {
    padding: 16px;
  }

  .topbar h1 {
    font-size: 30px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .activity-panel {
    grid-column: auto;
  }

  .bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(47, 53, 79, 0.12);
    border-radius: 18px;
    background: rgba(255, 253, 248, 0.92);
    box-shadow: 0 18px 50px rgba(47, 53, 79, 0.18);
    backdrop-filter: blur(18px);
  }

  .bottom-item {
    display: grid;
    place-items: center;
    gap: 3px;
    min-height: 56px;
    border: 0;
    border-radius: 18px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 500;
  }

  .bottom-item span {
    font-size: 18px;
  }

  .bottom-item.active {
    color: #ffffff;
    background: var(--navy);
  }

  .table-head {
    display: none;
  }

  .table-row {
    grid-template-columns: 1fr 1fr;
  }

  .invoice-actions,
  .edit-item-row {
    grid-template-columns: 1fr;
  }

  .transaction-form-page {
    grid-template-columns: 1fr;
  }

  .payment-field-grid {
    grid-template-columns: 1fr;
  }

  .detail-status-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .payment-toggle {
    justify-content: space-between;
    width: 100%;
  }

  .pdf-preview-shell {
    margin: 0;
    padding: 0;
    border-radius: 0;
    overflow-x: auto;
  }

  .pdf-preview-frame,
  .pdf-preview-loading {
    width: 100%;
    height: 72vh;
    min-height: 520px;
  }

  .invoice-preview {
    padding: 18px;
    min-width: 0;
  }

  .preview-top {
    display: grid;
  }

  .preview-top img {
    max-width: 210px;
    width: 70%;
  }

  .preview-top h3 {
    text-align: left;
  }

  .preview-info-grid,
  .preview-bottom {
    grid-template-columns: 1fr;
  }

  .table-row span:nth-of-type(1),
  .table-row span:nth-of-type(3) {
    display: none;
  }

  .product-log-row {
    grid-template-columns: 1fr;
  }

  .product-log-row > div:last-child {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
}


