:root {
  --green: #7db800;
  --green-dark: #4e7400;
  --green-bg: #1a2200;
  --bg: #0d0d0d;
  --card: #111111;
  --card2: #1a1a1a;
  --text: #f0f0f0;
  --muted: #666666;
  --border: #2a2a2a;
  --warn: #f59e0b;
  --blue: #1d4ed8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  min-height: 100vh;
}

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; }

.app-header {
  background: var(--card);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header img { height: 30px; width: auto; }
.header-right { margin-left: auto; font-size: 0.8rem; color: var(--muted); }

.content { padding: 1rem; }

.card { background: var(--card); border-radius: 12px; padding: 1rem; margin-bottom: 0.75rem; }
.card-green { border-left: 3px solid var(--green); }

.stat-bar {
  display: flex;
  justify-content: space-around;
  background: var(--card);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--green);
}
.stat-val { font-size: 1.3rem; font-weight: 700; color: var(--green); text-align: center; }
.stat-label { font-size: 0.65rem; color: var(--muted); text-align: center; }

.btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.5rem;
  min-height: 44px;
}
.btn-primary   { background: var(--green); color: #fff; }
.btn-secondary { background: transparent; color: var(--green); border: 1px solid var(--green); }
.btn-warn      { background: transparent; color: var(--warn); border: 1px solid var(--warn); }
.btn-blue      { background: var(--blue); color: #fff; }
.btn:disabled  { opacity: 0.5; cursor: not-allowed; }

.gps-badge {
  background: var(--green-bg);
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.gps-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 0.4rem;
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.field { margin-bottom: 0.75rem; }
.field label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.3rem; }
.field textarea, .field input[type=text] {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}
.field textarea:focus, .field input:focus { border-color: var(--green); }

.photo-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.photo-thumb { width: 80px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.photo-add-btn {
  width: 80px; height: 70px;
  background: var(--card2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--muted);
  cursor: pointer;
}

.sig-canvas-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  margin-top: 0.5rem;
  overflow: hidden;
}
.sig-canvas-wrap canvas { display: block; touch-action: none; width: 100%; height: 160px; }
.sig-actions { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.sig-actions button { flex: 1; padding: 0.4rem; border-radius: 6px; border: none; cursor: pointer; font-size: 0.8rem; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}
.login-logo { height: 60px; margin-bottom: 0.5rem; }
.login-tagline { font-size: 0.8rem; color: var(--muted); font-style: italic; margin-bottom: 2rem; }
.login-wrap input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  margin-bottom: 0.75rem;
}
.login-wrap input:focus { border-color: var(--green); }

.error-msg { color: #ef4444; font-size: 0.85rem; margin-bottom: 0.75rem; text-align: center; }
.muted { color: var(--muted); font-size: 0.85rem; }
.visit-meta { display: flex; justify-content: space-between; font-size: 0.85rem; margin-top: 0.25rem; }
.badge-green { color: var(--green); font-weight: 700; }
.success-msg { color: var(--green); text-align: center; padding: 1rem 0; font-weight: 600; }
