* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #222;
  background: #f6f7f9;
}
main { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }

.site-header {
  background: #fff;
  border-bottom: 1px solid #e3e5e8;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-header .brand { font-weight: 700; font-size: 18px; text-decoration: none; color: #222; }
.site-header nav { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.site-header nav a { color: #345; text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }
.site-header .user { color: #778; font-size: 13px; }

.site-footer { text-align: center; padding: 24px; color: #99a; }

h1 { font-size: 26px; margin: 0 0 16px; }
h2 { font-size: 20px; margin: 24px 0 8px; }
h3 { font-size: 16px; margin: 16px 0 4px; }
.muted { color: #99a; }

a { color: #2862c7; }
a.button, button {
  display: inline-block;
  background: #2862c7;
  color: #fff;
  border: 0;
  padding: 8px 14px;
  border-radius: 4px;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
a.button:hover, button:hover { background: #1d4fa8; }
button[type=button], .remove-row { background: #e3e5e8; color: #333; }
button[type=button]:hover, .remove-row:hover { background: #cfd3d8; }
.remove-row { padding: 2px 8px; font-weight: 700; }

form.form-narrow {
  max-width: 360px; background: #fff; padding: 20px;
  border: 1px solid #e3e5e8; border-radius: 6px;
}
form.form-narrow label { display: block; margin-bottom: 12px; }
form.form-narrow input {
  display: block; width: 100%; padding: 8px;
  border: 1px solid #c3c7cc; border-radius: 4px; font: inherit;
}

.error  { background: #fde7e7; border: 1px solid #f3b5b5; color: #a33; padding: 10px 14px; border-radius: 4px; }
.notice { background: #e7f6ea; border: 1px solid #b9dec3; color: #276b3a; padding: 10px 14px; border-radius: 4px; }

table.list {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e3e5e8; border-radius: 6px; overflow: hidden;
}
table.list th, table.list td {
  padding: 10px 12px; border-bottom: 1px solid #eef0f2;
  text-align: left; font-size: 14px;
}
table.list th { background: #fafbfc; font-weight: 600; }
table.list tr:last-child td { border-bottom: 0; }

.quote-form fieldset {
  background: #fff; border: 1px solid #e3e5e8; border-radius: 6px;
  padding: 16px 20px; margin-bottom: 16px;
}
.quote-form legend { padding: 0 8px; font-weight: 600; }
.quote-form label { display: block; margin-bottom: 10px; }
.quote-form input, .quote-form textarea {
  width: 100%; padding: 8px; border: 1px solid #c3c7cc;
  border-radius: 4px; font: inherit;
}
.quote-form .actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.quote-form .totals { margin-top: 12px; font-size: 14px; color: #445; }

table.items-edit { width: 100%; border-collapse: collapse; }
table.items-edit th { text-align: left; font-size: 13px; color: #667; font-weight: 600; padding: 6px 4px; }
table.items-edit td { padding: 4px; vertical-align: top; }
table.items-edit td textarea, table.items-edit td input { width: 100%; }
table.items-edit td.line-total { text-align: right; padding-top: 10px; white-space: nowrap; }
table.items-edit .qty, table.items-edit .price { text-align: right; }

.revisions { margin-top: 24px; }
.revisions ul { list-style: none; padding: 0; }
.revisions li { padding: 8px 0; border-bottom: 1px solid #eef0f2; }

form.danger { margin-top: 40px; }
form.danger button { background: #c73a3a; }
form.danger button:hover { background: #a22c2c; }

.view-actions { margin: 12px 0 24px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Quote document (view + print) */
.quote-doc {
  background: #fff; padding: 40px;
  border: 1px solid #e3e5e8; border-radius: 6px;
}
.quote-doc__logos {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid #e3e5e8;
}
.quote-doc__logos img { max-height: 60px; width: auto; }
.quote-doc__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.quote-doc__company h2 { margin: 0 0 4px; }
.quote-doc__company p { margin: 2px 0; color: #556; font-size: 14px; }
.quote-doc__meta { text-align: right; }
.quote-doc__meta h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: 1px; color: #667; }
.quote-doc__meta dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 2px 12px; font-size: 14px; }
.quote-doc__meta dt { color: #667; text-align: right; }
.quote-doc__meta dd { margin: 0; text-align: right; font-weight: 500; }

.quote-doc__client { margin-top: 24px; }
.quote-doc__client p { margin: 2px 0; }
.quote-doc__title { margin-top: 24px; font-size: 18px; }

.quote-doc__items { width: 100%; border-collapse: collapse; margin-top: 20px; }
.quote-doc__items th { text-align: left; border-bottom: 2px solid #333; padding: 8px 6px; font-size: 13px; }
.quote-doc__items td { padding: 8px 6px; border-bottom: 1px solid #e3e5e8; vertical-align: top; }
.quote-doc__items th:nth-child(n+2),
.quote-doc__items td:nth-child(n+2) { text-align: right; white-space: nowrap; }
.quote-doc__items tfoot th { text-align: right; border-bottom: 0; border-top: 1px solid #e3e5e8; padding-top: 8px; }
.quote-doc__items tfoot td { text-align: right; border-bottom: 0; border-top: 1px solid #e3e5e8; }
.quote-doc__items tfoot tr:last-child th,
.quote-doc__items tfoot tr:last-child td { border-top: 2px solid #333; font-size: 16px; }

.quote-doc__notes, .quote-doc__terms { margin-top: 20px; font-size: 14px; }
.quote-doc__notes p, .quote-doc__terms p { color: #445; }
