:root {
  --bg: #f7f9f8;
  --card: #ffffff;
  --text: #1d2b26;
  --muted: #586963;
  --brand: #1e6f4f;
  --brand-2: #2a8c63;
  --line: #d7e1dc;
  --danger: #b53f3f;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  background: linear-gradient(120deg, #184f39, #2a8c63);
  color: #fff;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
}

.subtitle {
  margin: 0.2rem 0 0;
  opacity: 0.95;
}

.top-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.container {
  max-width: 1100px;
  margin: 1rem auto;
  padding: 0 1rem 2rem;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

h2, h3 {
  margin-top: 0;
}

.grid-form {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid-form .full {
  grid-column: 1 / -1;
}

label span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.92rem;
}

input, select, textarea, button {
  width: 100%;
  padding: 0.58rem;
  border: 1px solid #b7c8c0;
  border-radius: 8px;
  font: inherit;
}

button {
  background: var(--brand);
  border: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--brand-2);
}

button.secondary {
  background: #496557;
}

button.danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.inline-actions {
  display: flex;
  gap: 0.7rem;
  align-items: end;
  flex-wrap: wrap;
}

.inline-actions label {
  min-width: 180px;
}

.tap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.tap-hen {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.tap-hen button {
  max-width: 88px;
}

.tiny {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.hen-row, .reminder-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.hen-row small, .reminder-row small {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 0.8rem;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem;
}

.stat b {
  font-size: 1.1rem;
}

.bars {
  display: grid;
  grid-template-columns: repeat(14, minmax(16px, 1fr));
  align-items: end;
  gap: 0.25rem;
  min-height: 130px;
}

.bar-wrap {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 0.2rem;
}

.bar {
  background: linear-gradient(180deg, #8fd4b3, #2a8c63);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}

.bar-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.4rem;
}

.cal-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.pro-panel {
  border: 1px dashed #8eb5a6;
  background: #f8fcfa;
}

footer {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
}

footer a {
  color: var(--brand);
}

@media (max-width: 820px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
