
:root {
  --navy: #142b4a;
  --blue: #245b91;
  --light: #f3f6fa;
  --border: #dce3ec;
  --text: #263445;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--light);
  color: var(--text);
}

.header {
  background: var(--navy);
  color: white;
  padding: 24px 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header h1 {
  margin: 0;
  letter-spacing: 3px;
  font-size: 30px;
}

.header p {
  margin: 5px 0 0;
  color: #cbd9e9;
}

.header span {
  font-size: 12px;
  letter-spacing: 1px;
  text-align: right;
}

.container {
  width: min(1180px, 92%);
  margin: 28px auto;
}

.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 3px 12px rgba(20, 43, 74, 0.04);
}

h2 {
  color: var(--navy);
  margin: 0 0 20px;
  font-size: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

input, select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: white;
  color: var(--text);
}

input:focus, select:focus {
  outline: 2px solid #b8d5f2;
  border-color: var(--blue);
}

.muted {
  font-size: 13px;
  color: #718096;
  margin-top: -10px;
  margin-bottom: 20px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.spec-item {
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.spec-item label {
  margin-bottom: 9px;
  color: var(--navy);
}

button {
  border: 0;
  background: var(--blue);
  color: white;
  padding: 13px 22px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .3px;
}

button:hover {
  filter: brightness(1.1);
}

.secondary {
  background: #e8edf3;
  color: var(--navy);
}

.action-panel {
  display: flex;
  gap: 12px;
}

.hidden {
  display: none;
}

.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.result-heading p {
  margin: 0;
  font-size: 13px;
  color: #68778a;
}

.document-label {
  font-size: 12px;
  color: var(--blue);
  font-weight: bold;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
  font-size: 12px;
}

th, td {
  border: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
}

th {
  background: var(--navy);
  color: white;
}

td:nth-child(3),
td:nth-child(5),
td:nth-child(6) {
  text-align: right;
}

.summary {
  width: min(480px, 100%);
  margin: 24px 0 0 auto;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.summary-row strong {
  text-align: right;
  white-space: nowrap;
}

.grand-total {
  margin-top: 8px;
  padding: 16px 12px;
  background: #eaf1f8;
  color: var(--navy);
  font-size: 15px;
  font-weight: bold;
  border: 1px solid #c9d9e9;
}

.signature {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 65px;
  min-height: 180px;
}

.signature-date {
  font-size: 12px;
}

.signature-block {
  width: 280px;
  text-align: center;
  font-size: 13px;
}

.signature-block p {
  margin: 5px 0;
}

.company-name {
  font-weight: bold;
}

.signature-space {
  height: 75px;
}

.signature-line {
  border-top: 1px solid #333;
  padding-top: 7px;
}

.print-actions {
  display: flex;
  gap: 12px;
  margin-top: 25px;
}

footer {
  background: var(--navy);
  color: #d7e2ee;
  text-align: center;
  padding: 18px;
  font-size: 12px;
}

@media (max-width: 700px) {
  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .spec-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 17px;
  }

  .result-heading {
    flex-direction: column;
  }

  .signature {
    flex-direction: column;
    gap: 35px;
  }

  .signature-block {
    align-self: flex-end;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  body {
    background: white;
    color: black;
    font-size: 10px;
  }

  .header, footer,
  .action-panel, .print-actions {
    display: none !important;
  }

  .container {
    width: 100%;
    margin: 0;
  }

  .panel {
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  #result {
    display: block !important;
  }

  .result-heading h2 {
    font-size: 17px;
  }

  table {
    font-size: 9px;
    min-width: 0;
  }

  th, td {
    padding: 6px;
  }

  .summary {
    width: 390px;
  }

  .signature {
    margin-top: 35px;
    min-height: 130px;
  }

  .signature-space {
    height: 55px;
  }

  .grand-total {
    background: #eaf1f8 !important;
    print-color-adjust: exact;
  }
}
