
:root {
  font-family: Inter, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  color: #35352e;
  background: #faf9f5;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }

.app {
  width: 90%;
  max-width: 1600px;
  margin: 38px auto;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 25px;
}
h1 { font-size: 32px; margin: 0 0 6px; }
.subtitle { color: #858477; margin: 0; }
.languages { display: flex; gap: 6px; }
.flag {
  font-size: 21px;
  padding: 6px 9px;
  background: white;
  border: 1px solid #e5e2d8;
  border-radius: 9px;
}
.flag.active {
  border-color: #628568;
  background: #e5efe3;
  box-shadow: 0 0 0 2px #d5e7d2;
}
.panel {
  background: white;
  border: 1px solid #e9e7df;
  border-radius: 17px;
  box-shadow: 0 10px 35px #3834260a;
  overflow: hidden;
}
.add {
  display: flex;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid #eeece5;
}
input {
  border: 1px solid #dddcd4;
  border-radius: 9px;
  padding: 12px;
  min-width: 0;
}
input:focus {
  outline: 2px solid #b9cbb1;
  outline-offset: 1px;
}
.add input { flex: 1; }
.btn {
  border: 1px solid #dddcd4;
  background: white;
  border-radius: 9px;
  padding: 10px 14px;
  color: #414139;
}
.btn:hover, .icon-btn:hover { filter: brightness(.97); }
.primary {
  background: #3e634a;
  color: white;
  border-color: #3e634a;
}
.status-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tab {
  border: 0;
  border-right: 1px solid #e5e2d8;
  padding: 16px 6px;
  font-weight: 600;
  font-size: 14px;
  color: #514d42;
  position: relative;
}
.tab:last-child { border-right: 0; }
.tab.active:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 12%;
  width: 76%;
  height: 3px;
  background: #464d3b;
  border-radius: 4px;
}
.tab.open { background: #d9ecd9; }
.tab.closed { background: #eae3d3; }
.tab.canceled { background: #f9dfc8; }
.tab.all { background: #faf8ee; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  color: #878478;
  font-size: 13px;
  gap: 12px;
  border-bottom: 1px solid #f0eee7;
}
.pages { display: flex; align-items: center; gap: 5px; }
.pages button {
  padding: 4px 8px;
  border: 1px solid #e4e1d8;
  border-radius: 5px;
  background: white;
}
.tasks { min-height: 125px; }
.task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0eee9;
}
.task:last-child { border-bottom: 0; }
.state-stack, .action-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  min-width: 155px;
}
.state {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  border: 1.5px solid #b2b5a8;
  background: white;
  color: #3e634a;
  font-size: 16px;
}
.task.closed .state {
  background: #e5eee2;
  border-color: #a5bba2;
}
.task.canceled .state { border-color: #efbd9d; }
.task-title {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  cursor: text;
  padding: 5px 0;
}
.task.closed .task-title {
  text-decoration: line-through;
  color: #96968b;
}
.task.canceled .task-title {
  text-decoration: line-through;
  color: #c4a998;
}
.task-date {
  font-size: 10px;
  color: #928f83;
  white-space: nowrap;
  line-height: 1.3;
}
.group-tag {
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.action-buttons { display: flex; gap: 8px; }
.icon-btn {
  border: 1px solid #e7e4db;
  background: white;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 18px;
}
.edit-wrap {
  flex: 1;
  display: flex;
  gap: 7px;
  min-width: 0;
}
.edit-wrap input { flex: 1; width: 100%; padding: 8px; }

.bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #eae7dc;
  padding: 14px 16px;
  background: #fbfaf7;
}
.group-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.group-filter {
  border: 1px solid #e4e0d5;
  border-radius: 9px;
  padding: 9px 12px;
  background: white;
  font-size: 13px;
}
.group-filter.active {
  outline: 2px solid #7b987a;
  outline-offset: 1px;
  font-weight: 650;
}
.manage { white-space: nowrap; }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  color: #8a877d;
  font-size: 12px;
}
.footer-actions { display: flex; gap: 8px; }
.empty {
  padding: 42px 20px;
  text-align: center;
  color: #a09d91;
}
.modal-back {
  position: fixed;
  inset: 0;
  background: #29291f80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}
.modal {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: white;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 18px 60px #0003;
}
.modal h2 { font-size: 20px; margin: 0 0 8px; }
.modal p { color: #888477; font-size: 13px; }
.group-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 300px;
  overflow: auto;
  margin: 18px 0;
}
.group-option {
  text-align: left;
  border: 1px solid #e9e6de;
  border-radius: 9px;
  padding: 10px 12px;
  background: white;
}
.group-option:hover { background: #edf2e9; }
.group-editor {
  display: grid;
  grid-template-columns: minmax(0,1fr) 45px auto auto;
  gap: 6px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #eeece6;
}
.group-editor input[type="text"] {
  width: 100%;
  padding: 8px;
}
.group-editor input[type="color"] {
  width: 42px;
  height: 38px;
  padding: 3px;
}
.group-editor .btn { padding: 8px; }
.new-group { display: flex; gap: 8px; margin-top: 16px; }
.new-group input[type="text"] { flex: 1; width: 100%; }
.new-group input[type="color"] {
  width: 48px;
  height: 44px;
  padding: 4px;
}
.modal-actions { text-align: right; margin-top: 16px; }

@media (max-width: 650px) {
  .app { margin: 20px auto; }
  .heading { flex-wrap: wrap; }
  .add { padding: 12px; }
  .task { padding: 12px; gap: 7px; flex-wrap: wrap; }
  .state-stack, .action-stack { min-width: 110px; }
  .task-date { font-size: 9px; }
  .group-tag { display: none; }
  .tab { font-size: 12px; padding: 14px 3px; }
  .bottom { flex-wrap: wrap; }
  .group-editor { grid-template-columns: minmax(0,1fr) 40px; }
}
