/* BoreWorks Field App — plain, field-readable styling. Big tap targets,
   high contrast for outdoor phone use. Print rules at the bottom turn any
   record view into a clean company-header sheet. */
:root {
  --green: #123c2b;
  --green2: #1d5c40;
  --amber: #e8a13a;
  --red: #b3261e;
  --ink: #17211c;
  --muted: #5c6a62;
  --line: #d7ded9;
  --bg: #f5f7f5;
  --card: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1rem; background: var(--green); color: #fff; flex-wrap: wrap; }
header .brand strong { font-size: 1.25rem; letter-spacing: .02em; }
header .brand-sub { opacity: .85; }
header .company-name { font-weight: 600; }
header button { background: transparent; color: #fff; border: 1px solid #ffffff66; border-radius: .4rem; padding: .35rem .6rem; cursor: pointer; }
.header-right { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.hidden { display: none !important; }
main { max-width: 980px; margin: 0 auto; padding: 1rem; }
footer { text-align: center; color: var(--muted); padding: 1.5rem 1rem; }
.banner { padding: .7rem 1rem; text-align: center; font-weight: 600; background: #fdf3d7; border-bottom: 2px solid var(--amber); }
.banner.danger { background: #fdecea; border-bottom-color: var(--red); color: var(--red); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; margin-bottom: 1rem; }
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
label { display: block; font-size: .85rem; font-weight: 600; margin: .6rem 0 .25rem; }
input, select, textarea { width: 100%; padding: .55rem; border: 1px solid var(--line); border-radius: .4rem; font-size: 1rem; background: #fff; }
textarea { min-height: 4.5rem; }
button.primary { background: var(--green2); color: #fff; border: 0; border-radius: .45rem; padding: .65rem 1.1rem; font-size: 1rem; font-weight: 700; cursor: pointer; }
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: #fff; border: 1px solid var(--line); border-radius: .45rem; padding: .5rem .9rem; cursor: pointer; }
button.danger { color: var(--red); border-color: var(--red); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
.row > button { flex: 0 0 auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { border-bottom: 1px solid var(--line); padding: .45rem .5rem; text-align: left; vertical-align: top; }
th { background: #eef2ee; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 1rem; font-size: .78rem; font-weight: 700; }
.badge.ok { background: #e2f2e4; color: var(--green2); }
.badge.warn { background: #fdf3d7; color: #8a5b00; }
.badge.bad { background: #fdecea; color: var(--red); }
.badge.grey { background: #eceff0; color: var(--muted); }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 2rem; padding: .45rem 1rem; cursor: pointer; font-weight: 600; }
.tabs button.on { background: var(--green); color: #fff; border-color: var(--green); }
.error { color: var(--red); font-weight: 600; }
.muted { color: var(--muted); }
.sigpad { border: 2px dashed var(--muted); border-radius: .5rem; background: #fff; touch-action: none; width: 100%; height: 140px; }
.planwrap { position: relative; max-width: 100%; }
.planwrap img { max-width: 100%; display: block; }
.planwrap canvas.overlay { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.swatch { width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--green); }
.print-head { display: none; }

/* ------- print: a clean sheet with the company header, nothing else --- */
@media print {
  header, footer, .noprint, .tabs, .banner, button { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .print-head { display: block; border-bottom: 3px solid var(--green); margin-bottom: 1rem; padding-bottom: .5rem; }
  .print-head .co { font-size: 1.4rem; font-weight: 800; }
  .card { border: 0; padding: 0; }
  .sig-img { max-width: 320px; border-bottom: 1px solid #000; }
}
