* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #172b4d;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #1f3a5f;
  color: white;
}
.topbar h1 { font-size: 1.2rem; margin: 0; }
.topbar-actions { display: flex; gap: 1rem; align-items: center; }
.btn-link {
  color: white;
  text-decoration: none;
  background: rgba(255,255,255,0.15);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}
.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1rem;
}
@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
}
.column {
  background: #ebecf0;
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 200px;
}
.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.column-header h2 { font-size: 1rem; margin: 0; }
.btn-add {
  border: none;
  background: #1f3a5f;
  color: white;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.task-list { min-height: 60px; display: flex; flex-direction: column; gap: 0.5rem; }
.task-card {
  position: relative;
  background: white;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  box-shadow: 0 1px 2px rgba(9,30,66,0.25);
}
.drag-handle {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #8993a4;
  border-radius: 4px;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; background: #f0f0f0; }
.task-title { font-weight: 600; margin-bottom: 0.25rem; padding-right: 1.75rem; }
.task-desc { font-size: 0.85rem; color: #5e6c84; margin-bottom: 0.4rem; }
.task-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: #dfe1e6;
}
.badge.assignee { background: #cce0ff; color: #0747a6; }
.badge.duration { background: #fff0b3; color: #7f5f01; }
.task-actions { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.task-actions button {
  font-size: 0.75rem;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  background: #f0f0f0;
}
.task-actions .btn-done { background: #57d9a3; color: #064; }
.sortable-ghost { opacity: 0.4; }

.login-box {
  max-width: 320px;
  margin: 4rem auto;
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(9,30,66,0.2);
  text-align: center;
}
.login-box form { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }
.login-box input, .login-box button { padding: 0.6rem; font-size: 1rem; }
.login-box button { background: #1f3a5f; color: white; border: none; border-radius: 6px; cursor: pointer; }
.error { color: #bf2600; }

dialog {
  border: none;
  border-radius: 8px;
  padding: 1.5rem;
  width: min(420px, 90vw);
}
dialog::backdrop { background: rgba(0,0,0,0.4); }
#task-form { display: flex; flex-direction: column; gap: 0.75rem; }
#task-form label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 0.25rem; }
#task-form input, #task-form textarea, #task-form select { padding: 0.5rem; font-size: 1rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.dialog-actions button { padding: 0.5rem 1rem; border-radius: 6px; border: none; cursor: pointer; }
#task-save { background: #1f3a5f; color: white; }
.btn-danger { background: #bf2600; color: white; margin-right: auto; }

.archive-table { width: 100%; border-collapse: collapse; margin: 1rem; }
.archive-table th, .archive-table td { text-align: left; padding: 0.5rem; border-bottom: 1px solid #ddd; }
