:root {
  --ink: #111;
  --muted: #555;
  --line: #333;
  --brand: #1a5c57;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  color: var(--ink);
  background: #e8eef2;
}

.no-print .toolbar,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #1a5c57;
  color: #fff;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.toolbar .muted { color: #d7ebe8; font-size: 0.9rem; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  font-family: "Segoe UI", Tahoma, sans-serif;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  background: #e5efed;
  color: #134540;
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn.primary { background: #ffe600; color: #222; }
.filter { font-size: 0.9rem; }
.filter select { margin-left: 6px; padding: 6px; }

.card, .msg {
  max-width: 960px;
  margin: 16px auto;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.msg.err { color: #8b2e2e; border: 1px solid #e2b6b6; background: #fbf0f0; }
.msg.ok { color: #1f6b4a; border: 1px solid #b7dfc8; background: #eefaf3; }
.muted { color: var(--muted); }

.app-card {
  max-width: 960px;
  margin: 12px auto;
  padding: 14px 16px;
  background: #fff;
  border-radius: 8px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}
.app-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #fff4df;
  color: #8a5a12;
}
.pill.submitted { background: #e4f5ec; color: #1f6b4a; }

/* Paper-like form */
.paper {
  max-width: 8.5in;
  margin: 16px auto;
  padding: 0.6in 0.7in;
  background: #fff;
  border: 1px solid #bbb;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.paper h1 {
  text-align: center;
  font-size: 16pt;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.paper .subtitle {
  text-align: center;
  font-size: 12pt;
  font-weight: bold;
  margin: 0 0 14px;
}
.paper .rules {
  font-size: 10pt;
  margin: 0 0 14px;
  line-height: 1.35;
}
.paper h2 {
  font-size: 11pt;
  margin: 14px 0 8px;
  border-bottom: 1px solid #000;
  padding-bottom: 2px;
  text-transform: uppercase;
}
.line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: end;
  margin: 6px 0;
  font-size: 11pt;
}
.line.two {
  grid-template-columns: auto 1fr auto 1fr;
}
.line label { white-space: nowrap; font-weight: bold; }
.line .fill {
  border-bottom: 1px solid #000;
  min-height: 1.1em;
  padding: 0 4px 1px;
}
.block {
  border: 1px solid #000;
  min-height: 1.6in;
  padding: 8px;
  margin-top: 6px;
  font-size: 11pt;
  white-space: pre-wrap;
}
table.log {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 10pt;
}
table.log th, table.log td {
  border: 1px solid #000;
  padding: 5px 6px;
  vertical-align: top;
}
table.log th { background: #f3f3f3; text-align: left; }
.sig {
  display: grid;
  grid-template-columns: 1fr 1.4in;
  gap: 16px;
  margin-top: 10px;
  font-size: 11pt;
}
.sig .fill { border-bottom: 1px solid #000; min-height: 1.2em; }
.checkline { margin: 8px 0; font-size: 10.5pt; }
.footer-note {
  margin-top: 16px;
  font-size: 9pt;
  color: #333;
}

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .paper {
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0.4in 0.5in;
    page-break-after: always;
  }
  .paper:last-child { page-break-after: auto; }
}
