:root {
  --bg: #fafaf7;
  --card: #ffffff;
  --ink: #212121;
  --muted: #757575;
  --line: #dfe7d9;
  --accent: #4CAF50;
  --accent-dark: #2E7D32;
  --accent-soft: #e8f5e9;
  --teal: #009688;
  --danger: #8b1e1e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-block { display: flex; align-items: center; }
.brand-link { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-link:hover { text-decoration: none; }
.brand-icon { width: 46px; height: 46px; border-radius: 10px; display: block; }
.brand-words { display: flex; flex-direction: column; line-height: 1.05; }
.brand { font-size: 1.45rem; font-weight: 900; color: var(--ink); letter-spacing: -.02em; }
.tagline { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.login-logo, .setup-logo { display: block; max-width: 330px; width: 72%; height: auto; margin: 0 auto 22px; }
.login-card h1 { text-align: center; }
.top-nav { display: flex; gap: 10px; flex-wrap: wrap; font-size: .95rem; }
.top-nav a { background: var(--accent-soft); padding: 7px 10px; border-radius: 999px; color: var(--accent-dark); }

.container { max-width: 1180px; margin: 22px auto; padding: 0 16px; }
.site-footer { text-align: center; color: var(--muted); padding: 30px 10px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.035);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.card-link { display: block; color: var(--ink); }
.card-link strong { color: var(--accent-dark); display: block; margin-bottom: 6px; }
.muted { color: var(--muted); }

h1, h2, h3 { line-height: 1.2; }
h1 { margin: 0 0 16px; }
h2 { margin-top: 0; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
label { display: block; font-weight: 650; margin-bottom: 6px; }
input, select, textarea, button {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
textarea { min-height: 90px; }
button, .button {
  display: inline-block;
  border: 0;
  background: var(--accent-dark);
  color: #fff;
  padding: 11px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}
button.secondary, .button.secondary { background: #5c645f; }
button.warning, .button.warning { background: var(--danger); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { background: var(--accent-soft); font-size: .92rem; }
tr:hover td { background: #fbfdf9; }
.number { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: .85rem; }
.badge.danger { background: #f6dddd; color: var(--danger); }

.flash { padding: 12px 14px; border-radius: 10px; margin: 12px 0; border: 1px solid; }
.flash.success { background: #e8f4ec; border-color: #b9d8c4; }
.flash.error { background: #fdecec; border-color: #e3b1b1; color: var(--danger); }

.product-lines { display: grid; gap: 8px; }
.product-line { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; align-items: end; }
.product-line.spray { grid-template-columns: 2fr 1fr 1fr; }
.helper { font-size: .86rem; color: var(--muted); margin-top: 4px; }

.report-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.print-only { display: none; }

@media (max-width: 760px) {
  .brand-icon { width: 40px; height: 40px; }
  .brand { font-size: 1.25rem; }
  .tagline { font-size: .8rem; }
  .site-header { position: static; }
  .product-line, .product-line.spray { grid-template-columns: 1fr; }
  th, td { font-size: .92rem; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .actions, form.no-print, .no-print { display: none !important; }
  .container { max-width: none; margin: 0; padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  a { color: #000; text-decoration: none; }
  .print-only { display: block; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; page-break-after: auto; }
}
