* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #1a1a1a;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 10px 0;
}

/* Outer scaling wrapper */
.viewport-wrapper {
  width: 100%;
  max-width: 100vw;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

/* Fixed A4 Canvas Base */
.a4-canvas {
  width: 210mm;
  height: 297mm;
  position: relative;
  background-color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transform-origin: top center;
}

/* Background Layer */
.layer-paper-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-image: url('background.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* Interactive Overlay */
.layer-editing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  padding: 12mm;
}

.meta-block {
  position: absolute;
  top: 48mm;
  left: 12mm;
  width: 186mm;
  display: flex;
  justify-content: space-between;
}

.table-block {
  position: absolute;
  top: 72mm;
  left: 12mm;
  width: 186mm;
}

.table-header {
  display: flex;
  font-weight: bold;
  font-size: 10pt;
  padding-bottom: 3mm;
}

.row {
  display: flex;
  align-items: center;
  margin-top: 2mm;
}

.col-desc { flex: 3; }
.col-qty  { flex: 1; text-align: center; }
.col-rate { flex: 1; text-align: right; }
.col-total{ flex: 1; text-align: right; font-weight: bold; }

.input-field {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #ccc;
  padding: 2mm;
  font-size: 10pt;
}

.totals-block {
  position: absolute;
  top: 235mm;
  right: 12mm;
  width: 70mm;
  text-align: right;
  font-size: 12pt;
}
