@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --dark: #26333B;
  --teal: #2E9E97;
  --teal-dark: #1F7A74;
  --grey: #7A868C;
  --line-grey: #E3E7E8;
  --row-alt: #F6F8F8;
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  background: #F1F4F4;
  color: var(--dark);
  margin: 0;
  padding: 0;
  font-weight: 300;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.topbar img { height: 44px; }

.topbar h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--dark);
}

.topbar .subtitle {
  font-size: 12px;
  color: var(--teal-dark);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 2px 10px rgba(38,51,59,0.06);
  margin-bottom: 24px;
}

.card h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--teal-dark);
  font-weight: 500;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line-grey);
  padding-bottom: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

label {
  display: block;
  font-size: 12px;
  color: var(--grey);
  margin-bottom: 5px;
  font-weight: 400;
}

input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-grey);
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--dark);
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
}

.field { margin-bottom: 16px; }

.readonly-box {
  background: var(--row-alt);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--grey);
}
.readonly-box strong { color: var(--dark); font-weight: 500; }

table.items {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}
table.items th {
  background: var(--dark);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-align: left;
  padding: 10px 10px;
}
table.items th.num, table.items td.num { text-align: right; }
table.items td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-grey);
}
table.items td input { border: 1px solid var(--line-grey); }
table.items .rm-btn {
  background: none;
  border: none;
  color: #C0392B;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 6px;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--teal-dark); color: #fff; }
.btn-primary:hover { background: var(--teal); }
.btn-secondary { background: #fff; color: var(--dark); border: 1px solid var(--line-grey); }
.btn-secondary:hover { border-color: var(--teal); color: var(--teal-dark); }
.btn-add {
  background: var(--row-alt);
  color: var(--teal-dark);
  border: 1px dashed var(--teal);
  font-size: 12.5px;
  padding: 8px 14px;
}

.actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }

.error-box {
  background: #FDECEA;
  border: 1px solid #F5C6C2;
  color: #B3261E;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 13px;
}

.totals-preview {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}
.totals-preview table { border-collapse: collapse; min-width: 320px; }
.totals-preview td { padding: 5px 4px; font-size: 13px; }
.totals-preview td.label { color: var(--grey); }
.totals-preview td.value { text-align: right; font-weight: 500; }
.totals-preview tr.final td {
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: var(--teal-dark);
  padding: 12px 10px;
}
.totals-preview tr.final td:first-child { border-radius: 6px 0 0 6px; }
.totals-preview tr.final td:last-child { border-radius: 0 6px 6px 0; }

.history-table { width: 100%; border-collapse: collapse; }
.history-table th {
  text-align: left; font-size: 11.5px; color: var(--grey); font-weight: 500;
  border-bottom: 1px solid var(--line-grey); padding: 8px 6px;
}
.history-table td { padding: 9px 6px; font-size: 13px; border-bottom: 1px solid var(--line-grey); }
.history-table a { color: var(--teal-dark); text-decoration: none; font-weight: 500; }
.history-table a:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  background: var(--row-alt);
  color: var(--teal-dark);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
}

.preview-frame {
  border: 1px solid var(--line-grey);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}
.preview-frame iframe { width: 100%; height: 780px; border: none; display: block; }
