:root {
  --bg: #f4f7f4;
  --card: #ffffff;
  --text: #102a1f;
  --muted: #54675f;
  --primary: #1f7a4c;
  --primary-dark: #155634;
  --danger: #b42318;
  --danger-dark: #7f1d1d;
  --border: #d7e2dc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at 10% 10%, #eef7f1 0, #f4f7f4 35%, #edf2ee 100%);
  color: var(--text);
}

a {
  color: var(--primary-dark);
}

.container {
  width: min(1200px, 92vw);
  margin: 2rem auto 3rem;
}

.container.narrow {
  width: min(640px, 92vw);
}

.home {
  text-align: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: 0 8px 28px rgba(20, 52, 37, 0.07);
}

.grid {
  display: grid;
  gap: 1rem;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid {
  display: grid;
  gap: 0.7rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid #bfd1c6;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fbfdfb;
}

textarea {
  resize: vertical;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.inline-check input {
  width: auto;
}

.button {
  border: none;
  border-radius: 10px;
  padding: 0.66rem 1rem;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button:hover {
  background: var(--primary-dark);
}

.button.secondary {
  background: #5f7b6b;
}

.button.secondary:hover {
  background: #42584c;
}

.button.light {
  background: #dce8e1;
  color: #1f3d2f;
}

.button.light:hover {
  background: #c7d8cf;
}

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

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

.button.tiny {
  padding: 0.48rem 0.72rem;
  font-size: 0.88rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.message {
  margin: 0.85rem 0;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
}

.message.error {
  background: #fce8e6;
  color: #8f1313;
  border: 1px solid #f4c0ba;
}

.message.success {
  background: #e4f6ea;
  color: #185f36;
  border: 1px solid #b7e4c6;
}

.table-card {
  margin-top: 1rem;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.tag {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-block;
}

.tag.on {
  background: #d8f2df;
  color: #1f7a4c;
}

.tag.off {
  background: #fce8e6;
  color: #a61d24;
}

.actions-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}
