* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: tahoma;
  background-color: #f0f0f0;
  color: #333;
  line-height: 1.6;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 1px solid #eff4f9;
  padding: 0 40px;
  min-height: 40px;
}
header .logo {
  display: flex;
  align-items: center;
}
header .logo img {
  width: 28px;
  height: 28px;
}
header .logo span {
  color: #2c4e6c;
  font-size: 18px;
  margin: auto 10px;
  white-space: nowrap;
}
header ul {
  list-style: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #2c4e6c;
  flex-wrap: wrap;
}
header ul li a {
  color: #2c4e6c;
  text-decoration: none;
}
header ul li button {
  background: #427199;
  font-size: 14px;
  width: 80px;
  height: 32px;
  border-radius: 2px;
  color: #fff;
  text-align: center;
  text-decoration: unset;
  line-height: 32px;
  border: none;
}

/* Container */
.container {
  width: 100%;
  padding: 0 40px 20px;
  background: linear-gradient(327.79deg,#eff4f9 -17.7%,rgba(239,244,249,0) 73.82%);
}

.invoice-wrapper {
  display: none; /* Hide all wrappers by default */
}

.invoice-wrapper:first-child {
  display: block; /* Show first wrapper by default */
}

/* Invoice Container */
.invoice-container {
  background-color: #fff;
  box-shadow: 1px 1px 25px rgba(66, 124, 172, .4);
  margin-top: 40px;
  border-bottom: 4px solid #427199;
  overflow: hidden;
}

/* Invoice Header */
.invoice-header {
  padding: 32px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
}

.logo {
  width: 50px;
  height: 50px;
  margin-right: 10px;
}

.company-info h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.company-info p {
  color: #333;
  font-size: 16px;
  line-height: 22px;
}

.invoice-type {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  font-weight: bold;
  font-size: 24px;
  color: #3f5161;
}
.invoice-type svg {
  width: 25px;
  height: 25px;
  margin-left: 12px;
}

.invoice-header-info {
  font-size: 14px;
  color: #3f5161;
}

/* Invoice Information */
.invoice-info .invoice-wrapper {
  padding: 0 32px;
}

.info-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 20px;
}

.status {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  font-size: 14px;
  color: #107c10;
}
.status svg {
  width: 20px;
  height: 20px;
  margin-left: 4px;
}

.btn {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: #f6f6f6;
}

.btn svg {
  margin-left: 6px;
}

/* Tabs */
.tabs {
  display: flex;
  margin-bottom: 26px;
  background-color: #f5f8fb;
  padding: 0 32px;
}

.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #666;
}

.tab.active {
  color: #333;
  border-bottom: 3px solid #427199;
}

/* Parties Information (Buyer & Seller) */
.parties-info {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  font-size: 14px;
}

.party-box {
  flex: 1;
  min-width: 300px;
}

.party-header {
  background-color: #427199;
  color: white;
  padding: 10px;
}

.party-content {
  padding: 15px 0;
}

.party-table {
  width: 100%;
  border-collapse: collapse;
}

.party-table td {
  padding: 6px 8px;
  min-width: 120px;
  vertical-align: top;
}
.party-table td > p {
  padding: 4px 5px;
  background: #f5f8fb;
  white-space: nowrap;
}

.party-label {
  width: 120px;
}

/* Summary Section */
.summary-section {
  margin-top: 25px;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.show-full {
  color: #1976d2;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.total-amount {
  padding: 0 0 5px;
  border-bottom: 1.5px solid #3f5161;
  font-size: 18px;
  color: #3f5161;
}
.total-amount span {
  margin-left: 32px;
  color: #427199;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.invoice-table, .summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.invoice-table {
  font-size: 14px;
  margin-bottom: 0;
}
.invoice-table th {
  background-color: #427199;
  color: white;
  text-align: right;
  padding: 10px;
  font-weight: inherit;
}
.invoice-table th:last-child {
  width: 40%;
  text-align: left;
  padding-left: 40px;
}

.invoice-table td, .summary-table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  text-align: right;
}

.invoice-table td:last-child {
  text-align: left;
  padding-left: 40px;
  background-color: #f5f8fb;
}

.empty-cell {
  width: 70%;
}
.summary-table td:not(.empty-cell) {
  background-color: #f5f8fb;
  color: #666;
}
.summary-table .empty-cell {
  border-bottom: 0;
}
.summary-label {
  font-weight: bold;
}
.total-row td {
  font-weight: bold;
  color: #333 !important;
}

/* Print Button Container */
.print-button-container {
  text-align: center;
  margin-top: 20px;
}

.print-button {
  background-color: #1976d2;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  margin: 0 auto;
}

.print-button svg {
  margin-right: 8px;
}


form .row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 20px;
  margin-bottom: 15px;
}
form .row.four {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
form .row.three {
  grid-template-columns: 1fr 1fr 1fr;
}
form .row.two {
  grid-template-columns: 1fr 1fr;
}
form label {
  font-size: 14px;
  color: rgb(65, 83, 98);
  display: block;
}
form input, form textarea {
  border: 1px solid #bacee0;
  height: 30px;
  padding: 0 5px;
  background: #f5f8fb;
  width: 100%;
}
form textarea {
  height: 60px;
}

.footer {
  text-align: center;
  font-size: 10px;
  margin-bottom: 20px;
}

/* Print Styles */
@media print {
  body {
      background-color: white;
  }
  
  .container {
      width: 100%;
      max-width: none;
      margin: 0;
      padding: 0;
  }
  
  .invoice-container {
      box-shadow: none;
  }
  
  .print-button-container {
      display: none;
  }
  
  .btn {
      display: none;
  }
}

/* Responsive Styles */
@media (min-width: 1366px) {
  form .row {
    grid-template-columns: 1fr 2fr 1fr;
  }
  form .row.four {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
  form .row.three {
    grid-template-columns: 1fr 1fr 1fr;
  }
  form .row.two {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 992px) {
  form .row {
    grid-template-columns: 1fr 2fr 1fr;
  }
  form .row.four {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
  form .row.three {
    grid-template-columns: 1fr 1fr;
  }
  form .row.two {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 991px) {
  form .row {
    grid-template-columns: 1fr;
  }
  form .row.four {
    grid-template-columns: 1fr 1fr;
  }
  form .row.three {
    grid-template-columns: 1fr;
  }
  form .row.two {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .container {
      padding: 0 10px 20px;
  }
  .invoice-info .invoice-wrapper {
    padding: 0 15px;
  }
  header {
    padding: 0 10px;
  }
  .header-content {
      flex-direction: column-reverse;
      align-items: flex-start;
  }
  
  .logo-area {
      margin-bottom: 15px;
  }
  
  .info-right {
      text-align: right;
      margin-top: 15px;
  }
  
  .action-buttons {
      justify-content: flex-start;
  }
  
  .parties-info {
      flex-direction: column;
  }
  
  .party-box {
      width: 100%;
      min-width: auto;
  }
  
  .summary-header {
      flex-direction: column;
      align-items: flex-start;
  }
  
  .total-amount {
      margin-top: 10px;
  }
  .empty-cell {
    width: 15%;
  }
}