:root {
  --green: #25d366;
  --green-dark: #128c7e;
  --green-soft: #e9f9ef;
  --white: #ffffff;
  --page: #f7f9fa;
  --text: #18212b;
  --muted: #8b949e;
  --line: #e5e9ec;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

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

button,
input {
  font: inherit;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 36px 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 8px 30px rgba(18, 140, 126, 0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--green-dark);
}

.logo-image {
  display: block;
  width: 112px;
  height: 30px;
  object-fit: contain;
  object-position: left center;
}

.logo-image-login {
  width: 156px;
  height: auto;
}

.login-card h1 {
  margin: 18px 0 8px;
  color: var(--green-dark);
}

.login-hint,
.env-badge {
  color: var(--green);
  margin: 0;
}

.login-form,
.modal {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

label {
  font-size: 0.9rem;
}

input {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  outline: none;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

button {
  border: 0;
  background: var(--green);
  color: var(--white);
  padding: 9px 14px;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
}

.ghost {
  background: var(--white);
  color: var(--green-dark);
  border: 1px solid var(--green);
}

.error {
  margin: 0;
  color: var(--green-dark);
}

.app-body {
  height: 100vh;
  overflow: hidden;
  background: var(--page);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 18px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.logout {
  color: var(--muted);
  text-decoration: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.logout:hover {
  color: var(--green-dark);
  background: var(--green-soft);
}

.logout svg {
  width: 20px;
  height: 20px;
}

.folder-bar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.folder-tabs-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
}

.folder-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.folder-tabs::-webkit-scrollbar {
  display: none;
}

.folder-tab,
.tab-add {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 34px;
  background: #f0f2f3;
  color: #65707b;
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.78rem;
}

.folder-tab[draggable="true"] {
  cursor: grab;
  user-select: none;
}

.folder-tab[draggable="true"]:active {
  cursor: grabbing;
}

.folder-tab.is-dragging {
  opacity: 0.45;
  border: 1px dashed var(--green);
}

.folder-tab[data-id="general"] {
  cursor: default;
}

.folder-tab.active,
.tab-add:hover {
  background: var(--green);
  color: var(--white);
}

.folder-count {
  margin-left: 4px;
  opacity: 0.65;
  font-size: 0.68rem;
}

.tab-add {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.board {
  width: min(620px, calc(100% - 32px));
  height: calc(100vh - 150px);
  margin: 28px auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.board-heading h1 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.board-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.status-tabs {
  display: flex;
  gap: 28px;
  margin: 18px 0;
  border-bottom: 1px solid var(--line);
}

.status-tab {
  position: relative;
  padding: 0 8px 12px;
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  font-size: 0.78rem;
}

.status-tab.active {
  color: var(--green-dark);
}

.status-tab.active::after {
  content: "";
  position: absolute;
  height: 2px;
  left: 0;
  right: 0;
  bottom: -1px;
  background: var(--green);
}

.status-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.65rem;
}

.add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(24, 33, 43, 0.04);
}

.add-form input {
  border: 0;
  box-shadow: none;
  border-radius: 6px;
  font-size: 0.78rem;
}

.add-form button {
  height: 38px;
}

.add-form[hidden] {
  display: none;
}

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0 6px 16px 0;
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--green) transparent;
  scrollbar-width: thin;
}

.todo-item,
.empty {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: 10px;
}

.todo-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.todo-item label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.todo-item input[type="checkbox"] {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
}

.todo-content {
  display: grid;
  gap: 4px;
}

.todo-text {
  color: var(--text);
}

.todo-meta {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.todo-item.is-done .todo-text {
  text-decoration: line-through;
  color: var(--muted);
}

.mini-badge {
  font-size: 0.78rem;
  color: var(--green);
  white-space: nowrap;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 110px;
  color: var(--muted);
  border-style: dashed;
  text-align: center;
  font-size: 0.76rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 140, 126, 0.35);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none !important;
  pointer-events: none;
}

.modal {
  width: min(420px, 100%);
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(18, 140, 126, 0.18);
}

.modal h3 {
  margin: 0;
  color: var(--green-dark);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .topbar {
    height: 56px;
  }

  .board {
    margin-top: 22px;
    height: calc(100vh - 134px);
  }
}
