:root {
  --green: #1f6f4a;
  --bg: #f4f6f5;
  --card-bg: #ffffff;
  --text: #1c1c1c;
  --muted: #6b7280;
  --danger: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--green);
  color: white;
  flex-wrap: wrap;
}

.topbar .brand { color: white; text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.topbar nav a, .topbar nav span { color: white; margin-left: 16px; text-decoration: none; font-size: 0.9rem; }

.container { max-width: 960px; margin: 0 auto; padding: 20px; }

.card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.card.narrow { max-width: 420px; margin: 40px auto; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.meter-header { display: flex; justify-content: space-between; align-items: center; }
.big-value { font-size: 1.8rem; font-weight: 700; margin: 8px 0 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--danger); }
.warning { color: #92610a; background: #fff6e0; padding: 8px 12px; border-radius: 8px; }

.btn {
  display: inline-block;
  background: var(--green);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn.secondary { background: #9aa0a6; }

form label { display: block; margin-bottom: 12px; font-size: 0.9rem; }
form input, form select { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #d1d5db; margin-top: 4px; }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 140px; }

.photo-input {
  display: block;
  background: #eef5f1;
  border: 2px dashed var(--green);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 12px;
}
.photo-input input { display: none; }

.preview { width: 100%; border-radius: 12px; margin-bottom: 12px; }
.value-input { font-size: 1.4rem; padding: 10px; width: 160px; border-radius: 8px; border: 1px solid #d1d5db; }

.table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee; font-size: 0.9rem; }

.live-power { display: flex; align-items: center; gap: 10px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #2fbf71; display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

.link { font-size: 0.9rem; }
