@page{
size:A4;
margin:20mm;
}

body{
font-family:Arial;
background:#f2f2f2;
}

.invoice{
width:210mm;
min-height:297mm;
background:white;
margin:auto;
padding:25px;
box-sizing:border-box;
display:flex;
flex-direction:column;
}

/* header */

.header{
display:flex;
align-items:center;
justify-content:space-between;
}

.main-logo{

width:120px;      /* fixed width */
height:50px;      /* fixed height */

object-fit:contain;

display:block;

margin:0 auto 5px auto;

}
.company{
flex:1;
text-align:center;
}

.company h2{
margin:0;
font-size:24px;
}

.company p{
margin:2px 0;
font-size:13px;
}

.date{
display:flex;
flex-direction:column;
align-items:flex-end;
font-size:13px;
}

.date input{
width:130px;
border:none;
text-align:right;
font-weight:bold;
background:transparent;
}

/* title */

.title{
text-align:center;
margin-top:15px;
padding:6px;
font-weight:bold;
border-top:2px solid black;
border-bottom:2px solid black;
}

/* info */

.info{
display:grid;
grid-template-columns:1fr 1fr;
gap:40px;
margin-top:25px;
}

.info label{
font-size:13px;
font-weight:bold;
}

.info input{
width:100%;
border:none;
border-bottom:2px solid black;
margin-bottom:18px;
background:transparent;
}

/* table */

table{
width:100%;
border-collapse:collapse;
margin-top:25px;
}

table, th, td{
border:1px solid black;
}

th{
background:#eee;
padding:8px;
}

td{
padding:6px;
}

td input{
width:100%;
border:none;
background:transparent;
}

/* buttons */

button{
margin-top:15px;
padding:8px;
border:1px solid black;
background:white;
cursor:pointer;
}

button:hover{
background:#eee;
}

/* total */

.total{
margin-top:25px;
text-align:right;
font-weight:bold;
}

.total input{
width:120px;
margin-left:10px;
}

.final{
margin-top:5px;
font-size:18px;
}

/* signature */

.signature{
margin-top:80px;
display:flex;
justify-content:space-between;
}

.signline{
width:250px;
border-top:2px solid black;
margin-bottom:5px;
}

/* actions */

.actions{
margin-top:25px;
display:flex;
gap:10px;
}

.actions button{
flex:1;
}

/* footer */

.footer{
margin-top:40px;
font-size:11px;
text-align:center;
border-top:1px solid #ccc;
padding-top:8px;
display:flex;
justify-content:space-between;
}

/* print */

@media print{

body{
background:white;
}

button{
display:none;
}

.invoice{
margin:0;
padding:0;
width:auto;
min-height:auto;
}

input{
border:none;
}

}