:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --panel: #ffffff;
  --line: #d7e1db;
  --text: #193126;
  --muted: #5f7669;
  --brand: #1f6f43;
  --brand-soft: #e9f5ee;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

h1, h2, h3 {
  margin: 0 0 0.65rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.container {
  width: min(1200px, 96%);
  margin: 1rem auto 2rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

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

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

input, select, textarea, button {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  font: inherit;
}

input[type="checkbox"] {
  width: auto;
  transform: scale(1.1);
}

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

button:hover {
  filter: brightness(1.06);
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem;
  background: #fcfefd;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem;
  text-align: left;
  font-size: 0.92rem;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  background: #fee4e2;
  color: var(--danger);
  font-size: 0.8rem;
  margin-inline-start: 0.35rem;
}

.warning {
  color: var(--danger);
  font-weight: 700;
  min-height: 1.2rem;
}

.muted {
  color: var(--muted);
}

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

canvas {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

#todoList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#todoList li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}

@media (max-width: 680px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
}
