/* Job Site QR System - Mobile-first, print-friendly */
:root {
  --primary: #2d5a27;
  --primary-light: #4a7c42;
  --primary-dark: #1a3d17;
  --bg: #f8faf8;
  --card: #fff;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --border: #ddd;
  --accent: #e8f0e6;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Header */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.site-header .subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

/* Customer header (on journey pages) */
.customer-header {
  background: var(--card);
  border-bottom: 2px solid var(--primary);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.customer-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
}

.customer-header .meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.customer-header .journey-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.customer-header .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.customer-header .nav-links a {
  font-size: 0.8125rem;
  color: var(--primary);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--primary);
  border-radius: 4px;
}

.customer-header .nav-links a:hover {
  background: var(--accent);
}

/* Main content */
main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

/* Journey hub buttons */
.journey-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.journey-btn {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border: 2px solid var(--primary);
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  transition: background 0.2s;
}

.journey-btn:hover {
  background: var(--accent);
}

.journey-btn .label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.25rem;
}

.journey-ref-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.journey-ref-list li { margin-bottom: 0.5rem; }
.journey-ref-list a {
  color: var(--primary);
  text-decoration: none;
}
.journey-ref-list a:hover { text-decoration: underline; }

/* Data blocks */
.data-block {
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow: hidden;
}

.data-block h3 {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--accent);
  font-size: 0.9375rem;
  color: var(--primary-dark);
}

.data-block .block-body {
  padding: 1rem;
}

.data-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-block td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.data-block td:first-child {
  color: var(--text-muted);
  width: 45%;
}

.data-block tr:last-child td {
  border-bottom: none;
}

.data-block .editable-cell {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: inherit;
  background: var(--card);
}

.data-block .editable-cell:focus {
  outline: none;
  border-color: var(--accent, #0ea5e9);
}

/* Checklist */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.checklist li:last-child {
  border-bottom: none;
}

.checklist .check {
  color: var(--primary);
  font-weight: bold;
}

/* Print styles */
@media print {
  body {
    background: #fff;
  }

  .site-header,
  .customer-header .nav-links,
  .no-print {
    display: none !important;
  }

  .customer-header {
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .data-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  main {
    max-width: none;
  }
}

/* Sticker print sheet */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
}

.sticker-item {
  border: 2px dashed var(--border);
  padding: 1rem;
  text-align: center;
}

.sticker-item .sticker-label {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.sticker-item .sticker-qr {
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

.sticker-item .sticker-qr canvas,
.sticker-item .sticker-qr img {
  width: 180px !important;
  height: 180px !important;
}

@media print {
  .sticker-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5in;
  }

  .sticker-item {
    width: 2.5in;
    height: 2.5in;
    padding: 0.25in;
  }

  .sticker-item .sticker-qr {
    width: 2in !important;
    height: 2in !important;
  }

  .sticker-item .sticker-qr canvas,
  .sticker-item .sticker-qr img {
    width: 2in !important;
    height: 2in !important;
  }
}
