* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  background: #f5f5f7; color: #1d1d1f; font-size: 14px;
}
.app { display: flex; height: 100vh; }

.sidebar {
  width: 240px; background: #fff; border-right: 1px solid #e5e5ea;
  display: flex; flex-direction: column; padding: 20px;
}
.sidebar-header h1 { font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.search-box input {
  width: 100%; padding: 8px 12px; border: 1px solid #e5e5ea;
  border-radius: 8px; font-size: 13px; outline: none; background: #f5f5f7;
}
.search-box input:focus { background: #fff; border-color: #0071e3; }
.tag-filter { margin-top: 20px; flex: 1; }
.tag-filter h3 { font-size: 12px; color: #86868b; text-transform: uppercase; margin-bottom: 8px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-item {
  padding: 4px 10px; border-radius: 12px; font-size: 12px;
  background: #f5f5f7; cursor: pointer; transition: all 0.15s;
}
.tag-item:hover { background: #e5e5ea; }
.tag-item.active { background: #0071e3; color: #fff; }
.sidebar-footer { margin-top: auto; }
.btn-logout { background: none; border: none; color: #86868b; cursor: pointer; font-size: 13px; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; background: #fff; border-bottom: 1px solid #e5e5ea;
}
.tabs { display: flex; gap: 4px; }
.tab {
  padding: 6px 16px; border: none; background: none; font-size: 14px;
  cursor: pointer; border-radius: 6px; color: #86868b;
}
.tab.active { background: #0071e3; color: #fff; }
.btn-new {
  padding: 8px 16px; background: #0071e3; color: #fff;
  border: none; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.btn-new:hover { background: #0077ed; }

.memo-list {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.memo-card {
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04); cursor: pointer;
  transition: box-shadow 0.15s;
}
.memo-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.memo-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.memo-card-title { font-size: 15px; font-weight: 500; flex: 1; }
.memo-card-priority { font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.priority-1 { background: #fff3cd; color: #856404; }
.priority-2 { background: #fce4e4; color: #c62828; }
.memo-card-meta { font-size: 12px; color: #86868b; display: flex; gap: 12px; flex-wrap: wrap; }
.memo-card-tags { display: flex; gap: 4px; margin-top: 6px; }
.memo-card-tag {
  font-size: 11px; padding: 1px 6px; background: #f0f0f5;
  border-radius: 4px; color: #636366;
}
.memo-card-actions { display: flex; gap: 8px; margin-top: 8px; }
.btn-done, .btn-delete, .btn-undo {
  font-size: 12px; padding: 4px 10px; border: 1px solid #e5e5ea;
  border-radius: 6px; background: #fff; cursor: pointer;
}
.btn-done:hover { background: #e8f5e9; border-color: #34c759; color: #34c759; }
.btn-delete:hover { background: #fce4e4; border-color: #ff3b30; color: #ff3b30; }
.btn-undo:hover { background: #fff3e0; border-color: #ff9500; color: #ff9500; }

.empty-state {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: #86868b; font-size: 15px;
}

.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3); display: flex;
  align-items: center; justify-content: center; z-index: 100;
}
.modal-content {
  background: #fff; border-radius: 16px; padding: 24px;
  width: 480px; max-width: 90vw;
}
.modal-content h2 { font-size: 18px; margin-bottom: 16px; }
.modal-content input, .modal-content textarea, .modal-content select {
  width: 100%; padding: 8px 12px; border: 1px solid #e5e5ea;
  border-radius: 8px; font-size: 14px; outline: none; margin-bottom: 10px;
  font-family: inherit;
}
.modal-content textarea { resize: vertical; }
.modal-content input:focus, .modal-content textarea:focus {
  border-color: #0071e3;
}
.edit-row { display: flex; gap: 10px; }
.edit-row > * { flex: 1; }
.reminder-edit { align-items: center; flex-wrap: wrap; }
.reminder-edit label { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.reminder-edit input[type="checkbox"] { width: auto; margin: 0; }
.modal-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.btn-save {
  padding: 8px 20px; background: #0071e3; color: #fff;
  border: none; border-radius: 8px; cursor: pointer;
}
.btn-cancel {
  padding: 8px 20px; background: #f5f5f7; border: none;
  border-radius: 8px; cursor: pointer;
}
.reminder-icon { font-size: 12px; color: #ff9500; }
