:root{
  --blue:#0d3d8b;
  --blue2:#143f97;
  --border:#d8deea;
  --text:#24324b;
  --muted:#637086;
  --danger:#e53935;
  --green:#0d8a41;
  --teal:#0f88a8;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: Arial, Helvetica, sans-serif;
  background:#ffffff;
  color:var(--text);
}

.page{
  width: 760px;
  margin: 12px auto;
  background: #fff;
  border: 1px solid #d7dce7;
  border-radius: 4px;
  overflow: hidden;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  padding: 14px 24px 8px;
  background:#fff;
}

.company h1{
  margin:0 0 8px;
  font-size: 23px;
  line-height:1.1;
  color:#17203a;
  font-weight:700;
}

.meta{
  display:flex;
  flex-direction:column;
  gap:4px;
  color:#323d4d;
  font-size:14px;
  font-weight: 600;
}
.meta_r{
  display:flex;
  flex-direction:column;
  gap:4px;
  color:#000000;
  font-size:14px;
}

.meta span{
  display:flex;
  align-items:center;
  gap:7px;
}

.logo{
  display:flex;
  flex-direction:column;
  align-items:center;
  color:var(--blue);
  font-weight:800;
  text-align:center;
  line-height:1.1;
}

.logo-mark{
  font-size:18px;
  margin-bottom:4px;
}

.logo-text{
  font-size:10px;
  letter-spacing:.4px;
}

.divider{
  height:2px;
  background:var(--blue2);
  margin-top:2px;
}

.content{
  background:
    radial-gradient(circle at 50% 48%, rgba(20,63,151,.05) 0 15%, transparent 16%),
    linear-gradient(180deg, #fff 0%, #fff 100%);
  padding: 12px 14px 16px;
}

.title-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin: 6px 0 10px;
}

.title-row:before,
.title-row:after{
  content:"";
  height:1px;
  width:120px;
  background:#8da0c6;
  display:block;
}

.dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--blue2);
}

.title-row h2{
  margin:0;
  font-size:28px;
  color:var(--blue2);
  font-weight:800;
}

.form-card{
  border:1px solid var(--border);
  border-radius:10px;
  padding: 14px 12px 12px;
  background: rgba(255,255,255,.85);
  overflow:hidden;
}

.form-grid{
  display:grid;
  grid-template-columns: 1.6fr .95fr;
  gap:18px;
  align-items:start;
}

.left-form{
  display:grid;
  grid-template-columns: 95px 1fr;
  gap:10px 10px;
  align-items:center;
  padding: 4px 6px 0 6px;
}

label{
  font-size:14px;
  color:#2d3c54;
  font-weight:500;
}

.input, .select, .cell-input{
  width:100%;
  height:36px;
  border:1px solid #d5dbe7;
  border-radius:5px;
  padding: 0 12px;
  font-size:14px;
  color:#39465d;
  background:#fff;
  outline:none;
}

.row-inline{
  display:grid;
  grid-template-columns: 1fr 1fr .7fr;
  gap:10px;
}

.net-box{
  background:#f8fbff;
  border:1px solid #cfd8e8;
  border-radius:8px;
  padding: 20px 18px;
  min-height:170px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  margin-top: 14px;
}

.net-box .caption{
  font-size:18px;
  color:var(--blue2);
  font-weight:700;
  margin-bottom:12px;
}

.net-amount{
  width:100%;
  background:linear-gradient(180deg, #0f4fbe 0%, #133f95 100%);
  color:#fff;
  font-weight:800;
  font-size:26px;
  text-align:center;
  padding: 14px 10px;
  border-radius:8px;
}

.net-words, .net-words-bottom{
  margin-top:10px;
  color:#40526f;
  font-size:14px;
  font-weight:600;
  text-align:center;
  line-height:1.35;
}

table{
  width:100%;
  border-collapse:collapse;
  margin-top:16px;
}

thead th{
  background:var(--blue2);
  color:#fff;
  font-size:14px;
  padding:9px 10px;
  text-align:center;
  border:1px solid #0f3a83;
}

tbody td{
  border:1px solid #d8deea;
  padding:6px;
  font-size:14px;
  color:#2f3b4f;
  background:#fff;
}

.total-row td{
  background:#f7f9ff;
  font-weight:800;
  font-size:15px;
}

.total-row .total-field{
  background:#f7f9ff;
  font-weight:800;
}

.cell-input{
  height:32px;
  border:none;
  box-shadow:none;
  padding: 0 8px;
  background: transparent;
}

.amount{
  text-align:right;
  padding-right:10px;
}

tbody td:nth-child(2),
tbody td:nth-child(4){
  width:110px;
}

tbody td:nth-child(5){
  width:42px;
  text-align:center;
}

.trash{
  color:var(--danger);
  cursor:pointer;
  font-size:18px;
  user-select:none;
}

.watermark{
  text-align:center;
  color:rgba(20,63,151,.10);
  font-weight:800;
  font-size:30px;
  letter-spacing:1px;
  margin: 8px 0 6px;
  user-select:none;
  pointer-events:none;
}

.add-row-wrap{
  display:flex;
  justify-content:center;
  margin: 4px 0 14px;
}

.btn{
  border:none;
  border-radius:5px;
  color:#fff;
  padding: 10px 18px;
  font-size:14px;
  cursor:pointer;
  min-width: 110px;
}

.btn.add{background:#1d4ea8;}
.btn.clear{background:#5f6b7b;}
.btn.print{background:#145dc5;}
.btn.pdf{background:var(--green);}

.summary{
  margin-top:8px;
  border:1px solid #d7deea;
  border-radius:8px;
  padding: 10px 16px;
  background:#f7faff;
  text-align:center;
  font-size:24px;
  font-weight:800;
  color:var(--blue2);
}
.sign{
  margin-top:8px;
  border:1px solid #d7deea;
  border-radius:8px;
  padding: 18px 16px;
  background:#f7faff;
  text-align:center;
  font-size:18px;
  font-weight:600;
  color:var(--green);
}

.note{
  margin-top:10px;
  text-align:center;
  font-size:13px;
  color:#4b5870;
  font-weight:600;
  font-style: italic;
}

.actions{
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
  margin: 18px 0 4px;
}

.footer {
  color: #000000;
  padding: 20px 10px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.footer-text {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.footer-credit {
  margin-top: 6px;
  font-size: 14px;
}

.footer a {
  color: #c40711;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

.footer a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  left: 0;
  bottom: -3px;
  background-color: #38bdf8;
  transition: width 0.3s ease;
}

.footer a:hover {
  color: #0ea5e9;
}

.footer a:hover::after {
  width: 100%;
}

@media print{
  body{
    background:#fff;
  }
  .actions,
  .add-row-wrap,
  .action-col,
  .trash{
    display:none !important;
  }
  .page{
    width:100%;
    margin:0;
    border:none;
  }
  .footer {
     display:none !important;
  }
}